diff options
author | Jim Raykowski <raykowj@gmail.com> | 2019-07-22 21:28:54 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2019-07-25 00:50:05 +0200 |
commit | ed882d693f37779e3a09641e7cd43b7a925d2312 (patch) | |
tree | ee4de17135965d7e1ec8a6f711fd880b63482496 | |
parent | 6131288f2a85d43ba21210e677648c9245793e52 (diff) |
tdf#47807 Invalidate bindings to Undo Redo
Change-Id: I71a16e60395003402372202a755b976d37690a27
Reviewed-on: https://gerrit.libreoffice.org/76146
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
-rw-r--r-- | include/svx/sdrundomanager.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/sdrundomanager.cxx | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx index 60a06bd546c5..854c4be54c51 100644 --- a/include/svx/sdrundomanager.hxx +++ b/include/svx/sdrundomanager.hxx @@ -63,6 +63,8 @@ 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 78e72e76196a..5d13d8e5e8a8 100644 --- a/svx/source/svdraw/sdrundomanager.cxx +++ b/svx/source/svdraw/sdrundomanager.cxx @@ -18,7 +18,10 @@ */ #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() @@ -146,4 +149,21 @@ 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: */ |