Kaydet (Commit) 81e91652 authored tarafından Armin Le Grand's avatar Armin Le Grand

i123350 Added Clear() implementation to SdrUndoManager to only delete text edit…

i123350 Added Clear() implementation to SdrUndoManager to only delete text edit part of the undo stack
üst f0577f5e
...@@ -51,6 +51,9 @@ public: ...@@ -51,6 +51,9 @@ public:
virtual sal_Bool Undo(); virtual sal_Bool Undo();
virtual sal_Bool Redo(); virtual sal_Bool Redo();
// ##
virtual void Clear();
// Call for the view which starts the interactive text edit. Use link to // Call for the view which starts the interactive text edit. Use link to
// activate (start text edit) and empty link to reset (end text edit). On // activate (start text edit) and empty link to reset (end text edit). On
// reset all text edit actions will be removed from this undo manager to // reset all text edit actions will be removed from this undo manager to
......
...@@ -85,6 +85,25 @@ sal_Bool SdrUndoManager::Redo() ...@@ -85,6 +85,25 @@ sal_Bool SdrUndoManager::Redo()
return bRetval; return bRetval;
} }
void SdrUndoManager::Clear()
{
if(isTextEditActive())
{
while(GetUndoActionCount() && mpLastUndoActionBeforeTextEdit != GetUndoAction(0))
{
RemoveLastUndoAction();
}
// urgently needed: RemoveLastUndoAction does NOT correct the Redo stack by itself (!)
ClearRedo();
}
else
{
// call parent
EditUndoManager::Clear();
}
}
void SdrUndoManager::SetEndTextEditHdl(const Link& rLink) void SdrUndoManager::SetEndTextEditHdl(const Link& rLink)
{ {
maEndTextEditHdl = rLink; maEndTextEditHdl = rLink;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment