summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-08-01 17:35:23 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-01 17:04:45 +0000
commit4cbaa49c0ee707a2e1e1d842279b32473e8c8a28 (patch)
treedc5fa102c9e8f8dbe68d18290607ee73d365ff1e /svx
parent2e3bc9fcee1c728d9fe91cbdf92b15d090c2b619 (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. Change-Id: Idad587e6ca07ba69bf59aa7013b251af8bf95bab Reviewed-on: https://gerrit.libreoffice.org/27781 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdmodel.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 8dafcc38c05b..b2b1475a10ac 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;
@@ -464,7 +465,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() )
@@ -485,7 +489,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() )
@@ -507,7 +514,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() )