richedit: Wrap even when message says not to repaint. (Fixes Bug 17290)

Dylan Smith dylan.ah.smith at gmail.com
Sat Feb 7 12:20:23 CST 2009


Wrapping is needed to be done even when repainting isn't done since
later messages expect line breaks to reflect the current text.  Some
message can specify not to paint the sceen, but this should prevent
wrapping from being done.

This patch prevented an assertion failure reported in Bug 17290, which
is caused when the assertion checks to see if a paragraph has been
wrapped.
---
 dlls/riched20/editor.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
-------------- next part --------------
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 2721745..032e99c 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -3431,7 +3431,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
     CHARFORMAT2W fmt;
     HDC hDC;
     BOOL bRepaint = LOWORD(lParam);
-    
+
     if (!wParam)
       wParam = (WPARAM)GetStockObject(SYSTEM_FONT); 
     GetObjectW((HGDIOBJ)wParam, sizeof(LOGFONTW), &lf);
@@ -3442,8 +3442,11 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
     ME_SetDefaultCharFormat(editor, &fmt);
 
     ME_CommitUndo(editor);
+    ME_MarkAllForWrapping(editor);
+    ME_WrapMarkedParagraphs(editor);
+    ME_UpdateScrollBar(editor);
     if (bRepaint)
-      ME_RewrapRepaint(editor);
+      ME_Repaint(editor);
     return 0;
   }
   case WM_SETTEXT:
@@ -4139,8 +4142,11 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
       ME_SetDefaultFormatRect(editor);
       editor->bDefaultFormatRect = TRUE;
     }
+    ME_MarkAllForWrapping(editor);
+    ME_WrapMarkedParagraphs(editor);
+    ME_UpdateScrollBar(editor);
     if (msg != EM_SETRECTNP)
-      ME_RewrapRepaint(editor);
+      ME_Repaint(editor);
     return 0;
   }
   case EM_REQUESTRESIZE:


More information about the wine-patches mailing list