[Libreoffice-commits] core.git: include/svx svx/source sw/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 25 16:06:36 UTC 2019


 include/svx/sdrundomanager.hxx       |    2 --
 svx/source/svdraw/sdrundomanager.cxx |   20 --------------------
 sw/source/core/undo/docundo.cxx      |   14 ++++++++++++++
 3 files changed, 14 insertions(+), 22 deletions(-)

New commits:
commit 3c7efab4e72d6f044a3ace34c06d2dfdfafbe42b
Author:     Jim Raykowski <raykowj at gmail..com>
AuthorDate: Thu Jul 25 00:16:04 2019 -0800
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Thu Jul 25 18:05:44 2019 +0200

    tdf#47807 Invalidate bindings to Undo Redo
    
    This patch reverts the previous commit made for this and provides a new
    fix.
    
    Change-Id: I487ecf0a7564f1130ef9a42e893e73185701d8c9
    Reviewed-on: https://gerrit.libreoffice.org/76287
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx
index 854c4be54c51..60a06bd546c5 100644
--- a/include/svx/sdrundomanager.hxx
+++ b/include/svx/sdrundomanager.hxx
@@ -63,8 +63,6 @@ public:
     // by a last undo during text edit
     bool isEndTextEditTriggeredFromUndo() { return mbEndTextEditTriggeredFromUndo; }
     void SetDocShell(SfxObjectShell* pDocShell);
-
-    virtual void AddUndoAction( std::unique_ptr<SfxUndoAction> pAction, bool bTryMerg=false ) override;
 };
 
 #endif // INCLUDED_SVX_SDRUNDOMANAGER_HXX
diff --git a/svx/source/svdraw/sdrundomanager.cxx b/svx/source/svdraw/sdrundomanager.cxx
index 5d13d8e5e8a8..78e72e76196a 100644
--- a/svx/source/svdraw/sdrundomanager.cxx
+++ b/svx/source/svdraw/sdrundomanager.cxx
@@ -18,10 +18,7 @@
  */
 
 #include <svx/sdrundomanager.hxx>
-#include <svx/svxids.hrc>
-#include <sfx2/bindings.hxx>
 #include <sfx2/objsh.hxx>
-#include <sfx2/viewfrm.hxx>
 #include <svl/hint.hxx>
 
 SdrUndoManager::SdrUndoManager()
@@ -149,21 +146,4 @@ void SdrUndoManager::EmptyActionsChanged()
     }
 }
 
-void SdrUndoManager::AddUndoAction( std::unique_ptr<SfxUndoAction> pAction, bool bTryMerg )
-{
-    EditUndoManager::AddUndoAction( std::move(pAction), bTryMerg);
-
-    if (m_pDocSh)
-    {
-        SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst(  m_pDocSh );
-        while ( pViewFrame )
-        {
-            pViewFrame->GetBindings().Invalidate( SID_UNDO );
-            pViewFrame->GetBindings().Invalidate( SID_REDO );
-            pViewFrame = SfxViewFrame::GetNext( *pViewFrame, m_pDocSh );
-        }
-    }
-}
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 06cf409f0731..ae5ca42a4b39 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -41,6 +41,9 @@
 #include <comphelper/lok.hxx>
 #include <assert.h>
 
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/bindings.hxx>
+
 using namespace ::com::sun::star;
 
 // the undo array should never grow beyond this limit:
@@ -526,6 +529,17 @@ void UndoManager::AddUndoAction(std::unique_ptr<SfxUndoAction> pAction, bool bTr
         }
     }
     SdrUndoManager::AddUndoAction(std::move(pAction), bTryMerge);
+    if (m_pDocShell)
+    {
+        SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst( m_pDocShell );
+        while ( pViewFrame )
+        {
+            pViewFrame->GetBindings().Invalidate( SID_UNDO );
+            pViewFrame->GetBindings().Invalidate( SID_REDO );
+            pViewFrame = SfxViewFrame::GetNext( *pViewFrame, m_pDocShell );
+        }
+    }
+
     // if the undo nodes array is too large, delete some actions
     while (UNDO_ACTION_LIMIT < GetUndoNodes().Count())
     {


More information about the Libreoffice-commits mailing list