[PATCH 23/24] [RichEdit]: don't force repaint while the redraw flag is off

Eric Pouech eric.pouech at orange.fr
Tue Jan 1 15:05:40 CST 2008




A+
---

 dlls/riched20/editor.c |    3 ++-
 dlls/riched20/paint.c  |   13 ++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 8287462..2ac6154 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2659,7 +2659,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
     ME_SendRequestResize(editor, TRUE);
     return 0;
   case WM_SETREDRAW:
-    editor->bRedraw = wParam;
+    if ((editor->bRedraw = wParam))
+      ME_RewrapRepaint(editor);
     return 0;
   case WM_SIZE:
   {
diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index 216ef0f..91e283a 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -109,7 +109,8 @@ void ME_UpdateRepaint(ME_TextEditor *editor)
 {
   /* Should be called whenever the contents of the control have changed */
   ME_Cursor *pCursor;
-  
+
+  if (!editor->bRedraw) return;
   if (ME_WrapMarkedParagraphs(editor))
     ME_UpdateScrollBar(editor);
   
@@ -135,10 +136,12 @@ ME_RewrapRepaint(ME_TextEditor *editor)
    * looks, but not content. Like resizing. */
   
   ME_MarkAllForWrapping(editor);
-  ME_WrapMarkedParagraphs(editor);
-  ME_UpdateScrollBar(editor);
-  
-  ME_Repaint(editor);
+  if (editor->bRedraw)
+  {
+    ME_WrapMarkedParagraphs(editor);
+    ME_UpdateScrollBar(editor);
+    ME_Repaint(editor);
+  }
 }
 
 int ME_twips2pointsX(ME_Context *c, int x)





More information about the wine-patches mailing list