Huw Davies : riched20: Use the multiline property rather than style.

Alexandre Julliard julliard at winehq.org
Tue Mar 16 16:39:03 CDT 2021


Module: wine
Branch: master
Commit: 1cf8fea7a7ab3fe83b06b2b41c92fb7d870e21ac
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1cf8fea7a7ab3fe83b06b2b41c92fb7d870e21ac

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Mar 16 08:22:48 2021 +0000

riched20: Use the multiline property rather than style.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/riched20/caret.c  |  4 ++--
 dlls/riched20/editor.c | 20 ++++++--------------
 dlls/riched20/paint.c  |  4 ++--
 3 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 6417bbde442..96765cba25d 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -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 */
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index b7c07058801..559ed88ea33 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -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;
diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 34d0ab8a54f..8ef5ada5855 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -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)
   {




More information about the wine-cvs mailing list