diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-01 17:35:23 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-02 10:55:53 +0200 |
commit | b0a1c742a92fa685d45492cbec8a0105375be884 (patch) | |
tree | 5b45ea021730d4f360fa652804ee6f1fcc351c18 /svx | |
parent | 2aa728780e273feaa3646f0299b727c02502c18d (diff) |
svl: implement SfxUndoAction::GetViewShellId() interface in SfxListUndoAction
Client code in sw, sd, sc and svx is adapted, the rest is just a
placeholder for now.
With this, e.g. the undo item for Writer's insert comment properly
tracks which window was used for the insertion.
Reviewed-on: https://gerrit.libreoffice.org/27781
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit 4cbaa49c0ee707a2e1e1d842279b32473e8c8a28)
Conflicts:
sc/source/ui/view/viewfun3.cxx
Change-Id: Idad587e6ca07ba69bf59aa7013b251af8bf95bab
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 6ae28cdf59b0..8d5ba7c4f0c9 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -93,6 +93,7 @@ #include <libxml/xmlwriter.h> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <comphelper/lok.hxx> +#include <sfx2/viewsh.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -483,7 +484,10 @@ void SdrModel::BegUndo() { if( mpImpl->mpUndoManager ) { - mpImpl->mpUndoManager->EnterListAction("","",0); + int nViewShellId = -1; + if (SfxViewShell* pViewShell = SfxViewShell::Current()) + nViewShellId = pViewShell->GetViewShellId(); + mpImpl->mpUndoManager->EnterListAction("","",0,nViewShellId); nUndoLevel++; } else if( IsUndoEnabled() ) @@ -504,7 +508,10 @@ void SdrModel::BegUndo(const OUString& rComment) { if( mpImpl->mpUndoManager ) { - mpImpl->mpUndoManager->EnterListAction( rComment, "", 0 ); + int nViewShellId = -1; + if (SfxViewShell* pViewShell = SfxViewShell::Current()) + nViewShellId = pViewShell->GetViewShellId(); + mpImpl->mpUndoManager->EnterListAction( rComment, "", 0, nViewShellId ); nUndoLevel++; } else if( IsUndoEnabled() ) @@ -526,7 +533,10 @@ void SdrModel::BegUndo(const OUString& rComment, const OUString& rObjDescr, SdrR { aComment = aComment.replaceFirst("%1", rObjDescr); } - mpImpl->mpUndoManager->EnterListAction( aComment,"",0 ); + int nViewShellId = -1; + if (SfxViewShell* pViewShell = SfxViewShell::Current()) + nViewShellId = pViewShell->GetViewShellId(); + mpImpl->mpUndoManager->EnterListAction( aComment,"",0,nViewShellId ); nUndoLevel++; } else if( IsUndoEnabled() ) |