diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-17 07:53:16 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-17 07:53:49 +0200 |
commit | e0a3269183bf145511361a3968dca07824923dd4 (patch) | |
tree | cae911ea3fa01fc6be867fdc3e0461fe532b5f57 /sd/source/ui/view/viewshe3.cxx | |
parent | f36406bf441704d8904f860d81774f0f89ab270a (diff) |
sd lok: limit undo/redo access to undo actions created by the same view
Unlike in Writer, the state and the exec method of .uno:Undo is
different codepath so for now ignore the Repair argument of the command,
assuming that the command is only dispatched if the command is enabled.
Change-Id: I3bfe8d72522f32efe436e21c383c99b3612eab6b
Diffstat (limited to 'sd/source/ui/view/viewshe3.cxx')
-rw-r--r-- | sd/source/ui/view/viewshe3.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index a23c752b5670..dbf6037a3165 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -71,6 +71,7 @@ #include "framework/FrameworkHelper.hxx" #include "optsitem.hxx" #include "sdresid.hxx" +#include "undo/undomanager.hxx" #include <svx/svxids.hrc> #include <sfx2/request.hxx> @@ -128,10 +129,15 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) if(pUndoManager) { + auto pSdUndoManager = dynamic_cast<sd::UndoManager*>(pUndoManager); + if (pSdUndoManager) + pSdUndoManager->SetViewShell(&GetViewShellBase()); if(pUndoManager->GetUndoActionCount() != 0) { bActivate = true; } + if (pSdUndoManager) + pSdUndoManager->SetViewShell(nullptr); } if(bActivate) @@ -155,10 +161,15 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) if(pUndoManager) { + auto pSdUndoManager = dynamic_cast<sd::UndoManager*>(pUndoManager); + if (pSdUndoManager) + pSdUndoManager->SetViewShell(&GetViewShellBase()); if(pUndoManager->GetRedoActionCount() != 0) { bActivate = true; } + if (pSdUndoManager) + pSdUndoManager->SetViewShell(nullptr); } if(bActivate) |