riched20: Use the multiline property rather than style.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2021-03-16 08:22:48 +00:00 committed by Alexandre Julliard
parent 030fbc4587
commit 1cf8fea7a7
3 changed files with 10 additions and 18 deletions

View File

@ -99,7 +99,7 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
length = ME_GetTextLength(editor);
if ((editor->styleFlags & ES_MULTILINE)
if ((editor->props & TXTBIT_MULTILINE)
&& (how->flags & GTL_USECRLF)
&& !editor->bEmulateVersion10) /* Ignore GTL_USECRLF flag in 1.0 emulation */
length += editor->nParagraphs - 1;
@ -549,7 +549,7 @@ void ME_InsertTextFromCursor(ME_TextEditor *editor, int nCursor,
int eol_len = 0;
/* Check if new line is allowed for this control */
if (!(editor->styleFlags & ES_MULTILINE))
if (!(editor->props & TXTBIT_MULTILINE))
break;
/* Find number of CR and LF in end of paragraph run */

View File

@ -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_Paragraph *para = cursor.para;
@ -3118,15 +3118,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
if (ed->props & TXTBIT_USEPASSWORD)
ITextHost_TxGetPasswordChar(texthost, &ed->cPasswordMask);
if (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->bWordWrap = (ed->props & TXTBIT_WORDWRAP) && (ed->props & TXTBIT_MULTILINE);
ed->notified_cr.cpMin = ed->notified_cr.cpMax = 0;
@ -3435,7 +3427,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
if (lParam)
editor->bDialogMode = TRUE;
if (editor->styleFlags & ES_MULTILINE)
if (editor->props & TXTBIT_MULTILINE)
code |= DLGC_WANTMESSAGE;
if (!(editor->props & TXTBIT_SAVESELECTION))
code |= DLGC_HASSETSEL;
@ -3784,7 +3776,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
}
case EM_LINESCROLL:
{
if (!(editor->styleFlags & ES_MULTILINE))
if (!(editor->props & TXTBIT_MULTILINE))
return FALSE;
ME_ScrollDown( editor, lParam * get_default_line_height( editor ) );
return TRUE;
@ -4579,7 +4571,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
case EM_SETTARGETDEVICE:
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)
{
editor->bWordWrap = new;
@ -4588,7 +4580,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
}
} else {
int width = max(0, lParam);
if ((editor->styleFlags & ES_MULTILINE) &&
if ((editor->props & TXTBIT_MULTILINE) &&
(!editor->bWordWrap || editor->nAvailWidth != width))
{
editor->nAvailWidth = width;

View File

@ -1086,7 +1086,7 @@ void ME_ScrollAbs(ME_TextEditor *editor, int x, int y)
bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0;
bScrollBarWillBeVisible = (editor->nTotalLength > editor->sizeWindow.cy
&& (editor->scrollbars & WS_VSCROLL)
&& (editor->styleFlags & ES_MULTILINE))
&& (editor->props & TXTBIT_MULTILINE))
|| (editor->scrollbars & ES_DISABLENOSCROLL);
if (bScrollBarIsVisible != bScrollBarWillBeVisible)
ITextHost_TxShowScrollBar(editor->texthost, SB_VERT,
@ -1211,7 +1211,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
/* Update vertical scrollbar */
bScrollBarWasVisible = editor->vert_si.nMax > editor->vert_si.nPage;
bScrollBarWillBeVisible = editor->nTotalLength > editor->sizeWindow.cy &&
(editor->styleFlags & ES_MULTILINE);
(editor->props & TXTBIT_MULTILINE);
if (editor->vert_si.nPos && !bScrollBarWillBeVisible)
{