Commit 5f88ba5b authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

riched20: Use BOOL type where appropriate.

parent 3ec51438
...@@ -904,7 +904,7 @@ static ME_DisplayItem* ME_FindPixelPosInTableRow(int x, int y, ...@@ -904,7 +904,7 @@ static ME_DisplayItem* ME_FindPixelPosInTableRow(int x, int y,
} }
static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow, static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow,
int x, ME_Cursor *cursor, int *pbCaretAtEnd) int x, ME_Cursor *cursor, BOOL *pbCaretAtEnd)
{ {
ME_DisplayItem *pNext, *pLastRun; ME_DisplayItem *pNext, *pLastRun;
ME_Row *row = &pRow->member.row; ME_Row *row = &pRow->member.row;
...@@ -964,7 +964,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y, ...@@ -964,7 +964,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
y -= editor->rcFormat.top; y -= editor->rcFormat.top;
if (is_eol) if (is_eol)
*is_eol = 0; *is_eol = FALSE;
/* find paragraph */ /* find paragraph */
for (; p != editor->pBuffer->pLast; p = p->member.para.next_para) for (; p != editor->pBuffer->pLast; p = p->member.para.next_para)
...@@ -1109,8 +1109,7 @@ static void ME_ExtendAnchorSelection(ME_TextEditor *editor) ...@@ -1109,8 +1109,7 @@ static void ME_ExtendAnchorSelection(ME_TextEditor *editor)
void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum) void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum)
{ {
ME_Cursor tmp_cursor; ME_Cursor tmp_cursor;
int is_selection = 0; BOOL is_selection = FALSE, is_shift;
BOOL is_shift;
editor->nUDArrowX = -1; editor->nUDArrowX = -1;
...@@ -1535,14 +1534,14 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl) ...@@ -1535,14 +1534,14 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
ME_CheckCharOffsets(editor); ME_CheckCharOffsets(editor);
switch(nVKey) { switch(nVKey) {
case VK_LEFT: case VK_LEFT:
editor->bCaretAtEnd = 0; editor->bCaretAtEnd = FALSE;
if (ctrl) if (ctrl)
success = ME_MoveCursorWords(editor, &tmp_curs, -1); success = ME_MoveCursorWords(editor, &tmp_curs, -1);
else else
success = ME_MoveCursorChars(editor, &tmp_curs, -1); success = ME_MoveCursorChars(editor, &tmp_curs, -1);
break; break;
case VK_RIGHT: case VK_RIGHT:
editor->bCaretAtEnd = 0; editor->bCaretAtEnd = FALSE;
if (ctrl) if (ctrl)
success = ME_MoveCursorWords(editor, &tmp_curs, +1); success = ME_MoveCursorWords(editor, &tmp_curs, +1);
else else
...@@ -1565,7 +1564,7 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl) ...@@ -1565,7 +1564,7 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
ME_ArrowCtrlHome(editor, &tmp_curs); ME_ArrowCtrlHome(editor, &tmp_curs);
else else
ME_ArrowHome(editor, &tmp_curs); ME_ArrowHome(editor, &tmp_curs);
editor->bCaretAtEnd = 0; editor->bCaretAtEnd = FALSE;
break; break;
} }
case VK_END: case VK_END:
......
...@@ -1633,7 +1633,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre ...@@ -1633,7 +1633,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
ME_Cursor linebreakCursor = *selEnd; ME_Cursor linebreakCursor = *selEnd;
ME_MoveCursorChars(editor, &linebreakCursor, -linebreakSize); ME_MoveCursorChars(editor, &linebreakCursor, -linebreakSize);
ME_GetTextW(editor, lastchar, 2, &linebreakCursor, linebreakSize, 0); ME_GetTextW(editor, lastchar, 2, &linebreakCursor, linebreakSize, FALSE);
if (lastchar[0] == '\r' && (lastchar[1] == '\n' || lastchar[1] == '\0')) { if (lastchar[0] == '\r' && (lastchar[1] == '\n' || lastchar[1] == '\0')) {
ME_InternalDeleteText(editor, &linebreakCursor, linebreakSize, FALSE); ME_InternalDeleteText(editor, &linebreakCursor, linebreakSize, FALSE);
} }
...@@ -2003,12 +2003,12 @@ static int ME_GetTextRange(ME_TextEditor *editor, WCHAR *strText, ...@@ -2003,12 +2003,12 @@ static int ME_GetTextRange(ME_TextEditor *editor, WCHAR *strText,
{ {
if (!strText) return 0; if (!strText) return 0;
if (unicode) { if (unicode) {
return ME_GetTextW(editor, strText, INT_MAX, start, nLen, 0); return ME_GetTextW(editor, strText, INT_MAX, start, nLen, FALSE);
} else { } else {
int nChars; int nChars;
WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1); WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1);
if (!p) return 0; if (!p) return 0;
nChars = ME_GetTextW(editor, p, nLen, start, nLen, 0); nChars = ME_GetTextW(editor, p, nLen, start, nLen, FALSE);
WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)strText, WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)strText,
nLen+1, NULL, NULL); nLen+1, NULL, NULL);
FREE_OBJ(p); FREE_OBJ(p);
...@@ -4702,7 +4702,7 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen, ...@@ -4702,7 +4702,7 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
int nLen; int nLen;
/* bCRLF flag is only honored in 2.0 and up. 1.0 must always return text verbatim */ /* bCRLF flag is only honored in 2.0 and up. 1.0 must always return text verbatim */
if (editor->bEmulateVersion10) bCRLF = 0; if (editor->bEmulateVersion10) bCRLF = FALSE;
pRun = start->pRun; pRun = start->pRun;
assert(pRun); assert(pRun);
...@@ -4987,7 +4987,7 @@ static BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, const ME_Cursor *start, i ...@@ -4987,7 +4987,7 @@ static BOOL ME_IsCandidateAnURL(ME_TextEditor *editor, const ME_Cursor *start, i
WCHAR bufferW[MAX_PREFIX_LEN + 1]; WCHAR bufferW[MAX_PREFIX_LEN + 1];
unsigned int i; unsigned int i;
ME_GetTextW(editor, bufferW, MAX_PREFIX_LEN, start, nChars, 0); ME_GetTextW(editor, bufferW, MAX_PREFIX_LEN, start, nChars, FALSE);
for (i = 0; i < sizeof(prefixes) / sizeof(*prefixes); i++) for (i = 0; i < sizeof(prefixes) / sizeof(*prefixes); i++)
{ {
if (nChars < prefixes[i].length) continue; if (nChars < prefixes[i].length) continue;
......
...@@ -256,7 +256,7 @@ void RTFInit(RTF_Info *info) ...@@ -256,7 +256,7 @@ void RTFInit(RTF_Info *info)
info->rtfLineNum = 0; info->rtfLineNum = 0;
info->rtfLinePos = 0; info->rtfLinePos = 0;
info->prevChar = EOF; info->prevChar = EOF;
info->bumpLine = 0; info->bumpLine = FALSE;
info->dwCPOutputCount = 0; info->dwCPOutputCount = 0;
if (!info->cpOutputBuffer) if (!info->cpOutputBuffer)
...@@ -722,7 +722,7 @@ static void _RTFGetToken2(RTF_Info *info) ...@@ -722,7 +722,7 @@ static void _RTFGetToken2(RTF_Info *info)
static int GetChar(RTF_Info *info) static int GetChar(RTF_Info *info)
{ {
int c; int c;
int oldBumpLine; BOOL oldBumpLine;
if ((c = _RTFGetChar(info)) != EOF) if ((c = _RTFGetChar(info)) != EOF)
{ {
...@@ -730,16 +730,16 @@ static int GetChar(RTF_Info *info) ...@@ -730,16 +730,16 @@ static int GetChar(RTF_Info *info)
info->rtfTextBuf[info->rtfTextLen] = '\0'; info->rtfTextBuf[info->rtfTextLen] = '\0';
} }
if (info->prevChar == EOF) if (info->prevChar == EOF)
info->bumpLine = 1; info->bumpLine = TRUE;
oldBumpLine = info->bumpLine; /* non-zero if prev char was line ending */ oldBumpLine = info->bumpLine; /* TRUE if prev char was line ending */
info->bumpLine = 0; info->bumpLine = FALSE;
if (c == '\r') if (c == '\r')
info->bumpLine = 1; info->bumpLine = TRUE;
else if (c == '\n') else if (c == '\n')
{ {
info->bumpLine = 1; info->bumpLine = TRUE;
if (info->prevChar == '\r') /* oops, previous \r wasn't */ if (info->prevChar == '\r') /* oops, previous \r wasn't */
oldBumpLine = 0; /* really a line ending */ oldBumpLine = FALSE; /* really a line ending */
} }
++info->rtfLinePos; ++info->rtfLinePos;
if (oldBumpLine) /* were we supposed to increment the */ if (oldBumpLine) /* were we supposed to increment the */
......
...@@ -1139,7 +1139,7 @@ struct _RTF_Info { ...@@ -1139,7 +1139,7 @@ struct _RTF_Info {
char *pushedTextBuf; char *pushedTextBuf;
int prevChar; int prevChar;
int bumpLine; BOOL bumpLine;
/* Document-wide attributes */ /* Document-wide attributes */
RTFFont *fontList; /* these lists MUST be */ RTFFont *fontList; /* these lists MUST be */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment