diff options
-rwxr-xr-x[-rw-r--r--] | include/svx/sdrundomanager.hxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/sdrundomanager.cxx | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx index f71f115dc1d3..9c88f062b92b 100644..100755 --- a/include/svx/sdrundomanager.hxx +++ b/include/svx/sdrundomanager.hxx @@ -48,6 +48,9 @@ public: virtual bool Undo(); virtual bool Redo(); + // #i123350# + virtual void Clear(); + // 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 // reset all text edit actions will be removed from this undo manager to diff --git a/svx/source/svdraw/sdrundomanager.cxx b/svx/source/svdraw/sdrundomanager.cxx index 4f97225383bd..f2a00c553d5f 100644 --- a/svx/source/svdraw/sdrundomanager.cxx +++ b/svx/source/svdraw/sdrundomanager.cxx @@ -80,6 +80,25 @@ bool SdrUndoManager::Redo() 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) { maEndTextEditHdl = rLink; |