Commit 1cf8fea7 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Use the multiline property rather than style.

parent 030fbc45
...@@ -99,7 +99,7 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how) ...@@ -99,7 +99,7 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
length = ME_GetTextLength(editor); length = ME_GetTextLength(editor);
if ((editor->styleFlags & ES_MULTILINE) if ((editor->props & TXTBIT_MULTILINE)
&& (how->flags & GTL_USECRLF) && (how->flags & GTL_USECRLF)
&& !editor->bEmulateVersion10) /* Ignore GTL_USECRLF flag in 1.0 emulation */ && !editor->bEmulateVersion10) /* Ignore GTL_USECRLF flag in 1.0 emulation */
length += editor->nParagraphs - 1; length += editor->nParagraphs - 1;
...@@ -549,7 +549,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor, ...@@ -549,7 +549,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
int eol_len = 0; int eol_len = 0;
/* Check if new line is allowed for this control */ /* Check if new line is allowed for this control */
if (!(editor->styleFlags & ES_MULTILINE)) if (!(editor->props & TXTBIT_MULTILINE))
break; break;
/* Find number of CR and LF in end of paragraph run */ /* Find number of CR and LF in end of paragraph run */
......
...@@ -2461,7 +2461,7 @@ static BOOL handle_enter(ME_TextEditor *editor) ...@@ -2461,7 +2461,7 @@ static BOOL handle_enter(ME_TextEditor *editor)
} }
} }
if (editor->styleFlags & ES_MULTILINE) if (editor->props & TXTBIT_MULTILINE)
{ {
ME_Cursor cursor = editor->pCursors[0]; ME_Cursor cursor = editor->pCursors[0];
ME_Paragraph *para = cursor.para; ME_Paragraph *para = cursor.para;
...@@ -3118,15 +3118,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ...@@ -3118,15 +3118,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
if (ed->props & TXTBIT_USEPASSWORD) if (ed->props & TXTBIT_USEPASSWORD)
ITextHost_TxGetPasswordChar(texthost, &ed->cPasswordMask); ITextHost_TxGetPasswordChar(texthost, &ed->cPasswordMask);
if (ed->props & TXTBIT_MULTILINE) { ed->bWordWrap = (ed->props & TXTBIT_WORDWRAP) && (ed->props & TXTBIT_MULTILINE);
ed->styleFlags |= ES_MULTILINE;
ed->bWordWrap = (ed->props & TXTBIT_WORDWRAP) != 0;
} else {
ed->bWordWrap = FALSE;
}
if (ed->props & TXTBIT_DISABLEDRAG)
ed->styleFlags |= ES_NOOLEDRAGDROP;
ed->notified_cr.cpMin = ed->notified_cr.cpMax = 0; ed->notified_cr.cpMin = ed->notified_cr.cpMax = 0;
...@@ -3435,7 +3427,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -3435,7 +3427,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
if (lParam) if (lParam)
editor->bDialogMode = TRUE; editor->bDialogMode = TRUE;
if (editor->styleFlags & ES_MULTILINE) if (editor->props & TXTBIT_MULTILINE)
code |= DLGC_WANTMESSAGE; code |= DLGC_WANTMESSAGE;
if (!(editor->props & TXTBIT_SAVESELECTION)) if (!(editor->props & TXTBIT_SAVESELECTION))
code |= DLGC_HASSETSEL; code |= DLGC_HASSETSEL;
...@@ -3784,7 +3776,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -3784,7 +3776,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
} }
case EM_LINESCROLL: case EM_LINESCROLL:
{ {
if (!(editor->styleFlags & ES_MULTILINE)) if (!(editor->props & TXTBIT_MULTILINE))
return FALSE; return FALSE;
ME_ScrollDown( editor, lParam * get_default_line_height( editor ) ); ME_ScrollDown( editor, lParam * get_default_line_height( editor ) );
return TRUE; return TRUE;
...@@ -4579,7 +4571,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -4579,7 +4571,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
case EM_SETTARGETDEVICE: case EM_SETTARGETDEVICE:
if (wParam == 0) if (wParam == 0)
{ {
BOOL new = (lParam == 0 && (editor->styleFlags & ES_MULTILINE)); BOOL new = (lParam == 0 && (editor->props & TXTBIT_MULTILINE));
if (editor->nAvailWidth || editor->bWordWrap != new) if (editor->nAvailWidth || editor->bWordWrap != new)
{ {
editor->bWordWrap = new; editor->bWordWrap = new;
...@@ -4588,7 +4580,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -4588,7 +4580,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
} }
} else { } else {
int width = max(0, lParam); int width = max(0, lParam);
if ((editor->styleFlags & ES_MULTILINE) && if ((editor->props & TXTBIT_MULTILINE) &&
(!editor->bWordWrap || editor->nAvailWidth != width)) (!editor->bWordWrap || editor->nAvailWidth != width))
{ {
editor->nAvailWidth = width; editor->nAvailWidth = width;
......
...@@ -1086,7 +1086,7 @@ void ME_ScrollAbs(ME_TextEditor *editor, int x, int y) ...@@ -1086,7 +1086,7 @@ void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0; bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0;
bScrollBarWillBeVisible = (editor->nTotalLength > editor->sizeWindow.cy bScrollBarWillBeVisible = (editor->nTotalLength > editor->sizeWindow.cy
&& (editor->scrollbars & WS_VSCROLL) && (editor->scrollbars & WS_VSCROLL)
&& (editor->styleFlags & ES_MULTILINE)) && (editor->props & TXTBIT_MULTILINE))
|| (editor->scrollbars & ES_DISABLENOSCROLL); || (editor->scrollbars & ES_DISABLENOSCROLL);
if (bScrollBarIsVisible != bScrollBarWillBeVisible) if (bScrollBarIsVisible != bScrollBarWillBeVisible)
ITextHost_TxShowScrollBar(editor->texthost, SB_VERT, ITextHost_TxShowScrollBar(editor->texthost, SB_VERT,
...@@ -1211,7 +1211,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) ...@@ -1211,7 +1211,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
/* Update vertical scrollbar */ /* Update vertical scrollbar */
bScrollBarWasVisible = editor->vert_si.nMax > editor->vert_si.nPage; bScrollBarWasVisible = editor->vert_si.nMax > editor->vert_si.nPage;
bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy && bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy &&
(editor->styleFlags & ES_MULTILINE); (editor->props & TXTBIT_MULTILINE);
if (editor->vert_si.nPos && !bScrollBarWillBeVisible) if (editor->vert_si.nPos && !bScrollBarWillBeVisible)
{ {
......
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