Phil Krylov : riched20: Empty undo stack after EM_STREAMIN without SFF_SELECTION flag.

Alexandre Julliard julliard at wine.codeweavers.com
Sun Feb 5 06:52:33 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 9b1beea7d719ce7874e60ac8dd02ad9eb09ef595
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=9b1beea7d719ce7874e60ac8dd02ad9eb09ef595

Author: Phil Krylov <phil at newstar.rinet.ru>
Date:   Sun Feb  5 12:18:55 2006 +0100

riched20: Empty undo stack after EM_STREAMIN without SFF_SELECTION flag.

---

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

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 2a458e7..b9ce162 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)




More information about the wine-cvs mailing list