riched20: Empty undo stack after EM_STREAMIN without SFF_SELECTION flag

Phil Krylov phil at newstar.rinet.ru
Sat Feb 4 14:29:11 CST 2006


ChangeLog:

riched20: Empty undo stack after EM_STREAMIN without SFF_SELECTION flag.

---

 dlls/riched20/editor.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

d3a92690cf1440ba8d39feaba7ca4aa917c47c02
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 0c9b3ff..8c7767b 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -664,14 +664,22 @@ static LRESULT ME_StreamIn(ME_TextEditor
   }
   
   editor->nUndoMode = nUndoMode;
-  pUI = ME_AddUndoItem(editor, diUndoDeleteRun, NULL);
-  TRACE("from %d to %d\n", from, to);
-  if (pUI && from < to)
+  if (format & SFF_SELECTION)
   {
-    pUI->nStart = from;
-    pUI->nLen = to-from;
+    pUI = ME_AddUndoItem(editor, diUndoDeleteRun, NULL);
+    TRACE("from %d to %d\n", from, to);
+    if (pUI && from < to)
+    {
+      pUI->nStart = from;
+      pUI->nLen = to-from;
+    }
+    ME_CommitUndo(editor);
+  }
+  else
+  {
+    ME_EmptyUndoStack(editor);
   }
-  ME_CommitUndo(editor);
+
   ME_ReleaseStyle(style); 
   editor->nEventMask = nEventMask;
   if (editor->bRedraw)
-- 
1.0.GIT



More information about the wine-patches mailing list