riched20: Empty undo stack after EM_STREAMIN without SFF_SELECTION flag.

This commit is contained in:
Phil Krylov 2006-02-05 12:18:55 +01:00 committed by Alexandre Julliard
parent 305ec4d08f
commit 9b1beea7d7
1 changed files with 14 additions and 6 deletions

View File

@ -664,6 +664,8 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
} }
editor->nUndoMode = nUndoMode; editor->nUndoMode = nUndoMode;
if (format & SFF_SELECTION)
{
pUI = ME_AddUndoItem(editor, diUndoDeleteRun, NULL); pUI = ME_AddUndoItem(editor, diUndoDeleteRun, NULL);
TRACE("from %d to %d\n", from, to); TRACE("from %d to %d\n", from, to);
if (pUI && from < to) if (pUI && from < to)
@ -672,6 +674,12 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
pUI->nLen = to-from; pUI->nLen = to-from;
} }
ME_CommitUndo(editor); ME_CommitUndo(editor);
}
else
{
ME_EmptyUndoStack(editor);
}
ME_ReleaseStyle(style); ME_ReleaseStyle(style);
editor->nEventMask = nEventMask; editor->nEventMask = nEventMask;
if (editor->bRedraw) if (editor->bRedraw)