richedit: Avoid rewrapping all text for isolated format changes.
authorDylan Smith <dylan.ah.smith@gmail.com>
Mon, 5 Jan 2009 18:14:41 +0000 (13:14 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 6 Jan 2009 11:52:09 +0000 (12:52 +0100)
When the character or paragraph format is changed the paragraph that
is changed is already marked to be rewrapped, so ME_MarkAllForWrapping
shouldn't be called.  Since ME_RewrapRepaint uses this function, it
shouldn't be called in these circumstances, since rewrapping all the
text can cause noticable delays when working with a lot of text.

dlls/riched20/editor.c

index c7b8f40cd502617e12a8645a05e07417337b000e..107dcea60e6b000cb0f165be0c6710cde9d2e62e 100644 (file)
@@ -3263,7 +3263,11 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
     }
     ME_CommitUndo(editor);
     if (bRepaint)
-      ME_RewrapRepaint(editor);
+    {
+      ME_WrapMarkedParagraphs(editor);
+      ME_UpdateScrollBar(editor);
+      ME_Repaint(editor);
+    }
     return 1;
   }
   case EM_GETCHARFORMAT:
@@ -3285,7 +3289,9 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
   case EM_SETPARAFORMAT:
   {
     BOOL result = ME_SetSelectionParaFormat(editor, (PARAFORMAT2 *)lParam);
-    ME_RewrapRepaint(editor);
+    ME_WrapMarkedParagraphs(editor);
+    ME_UpdateScrollBar(editor);
+    ME_Repaint(editor);
     ME_CommitUndo(editor);
     return result;
   }