openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1530254 - in /openoffice/trunk/main/svx: inc/svx/sdrundomanager.hxx source/svdraw/sdrundomanager.cxx
Date Tue, 08 Oct 2013 12:38:04 GMT
Author: alg
Date: Tue Oct  8 12:38:03 2013
New Revision: 1530254

URL: http://svn.apache.org/r1530254
Log:
i123350 Added Clear() implementation to SdrUndoManager to only delete text edit part of the
undo stack

Modified:
    openoffice/trunk/main/svx/inc/svx/sdrundomanager.hxx
    openoffice/trunk/main/svx/source/svdraw/sdrundomanager.cxx

Modified: openoffice/trunk/main/svx/inc/svx/sdrundomanager.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/svx/sdrundomanager.hxx?rev=1530254&r1=1530253&r2=1530254&view=diff
==============================================================================
--- openoffice/trunk/main/svx/inc/svx/sdrundomanager.hxx (original)
+++ openoffice/trunk/main/svx/inc/svx/sdrundomanager.hxx Tue Oct  8 12:38:03 2013
@@ -51,6 +51,9 @@ public:
     virtual sal_Bool Undo();
     virtual sal_Bool Redo();
 
+    // ##
+    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

Modified: openoffice/trunk/main/svx/source/svdraw/sdrundomanager.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/svdraw/sdrundomanager.cxx?rev=1530254&r1=1530253&r2=1530254&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/svdraw/sdrundomanager.cxx (original)
+++ openoffice/trunk/main/svx/source/svdraw/sdrundomanager.cxx Tue Oct  8 12:38:03 2013
@@ -85,6 +85,25 @@ sal_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; 



Mime
View raw message