summaryrefslogtreecommitdiffstats
path: root/svl/source/undo
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 /svl/source/undo
parentrefine ISOWEEKNUM vs WEEKNUM_OOO detection (diff)
downloadcore-4cbaa49c0ee707a2e1e1d842279b32473e8c8a28.tar.gz
core-4cbaa49c0ee707a2e1e1d842279b32473e8c8a28.zip
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 'svl/source/undo')
-rw-r--r--svl/source/undo/undo.cxx18
1 files changed, 13 insertions, 5 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 2de91945e2fc..e9b2c0681a8d 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -998,7 +998,8 @@ void SfxUndoManager::RemoveUndoListener( SfxUndoListener& i_listener )
* Inserts a ListUndoAction and sets its UndoArray as current.
*/
void SfxUndoManager::EnterListAction( const OUString& rComment,
- const OUString &rRepeatComment, sal_uInt16 nId )
+ const OUString &rRepeatComment, sal_uInt16 nId,
+ sal_Int32 nViewShellId )
{
UndoManagerGuard aGuard( *m_xData );
@@ -1009,7 +1010,7 @@ void SfxUndoManager::EnterListAction( const OUString& rComment,
return;
m_xData->pFatherUndoArray = m_xData->pActUndoArray;
- SfxListUndoAction* pAction = new SfxListUndoAction( rComment, rRepeatComment, nId, m_xData->pActUndoArray );
+ SfxListUndoAction* pAction = new SfxListUndoAction( rComment, rRepeatComment, nId, nViewShellId, m_xData->pActUndoArray );
OSL_VERIFY( ImplAddUndoAction_NoNotify( pAction, false, false, aGuard ) );
// expected to succeed: all conditions under which it could fail should have been checked already
m_xData->pActUndoArray = pAction;
@@ -1265,12 +1266,13 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const
struct SfxListUndoAction::Impl
{
sal_uInt16 mnId;
+ sal_Int32 mnViewShellId;
OUString maComment;
OUString maRepeatComment;
- Impl( sal_uInt16 nId, const OUString& rComment, const OUString& rRepeatComment ) :
- mnId(nId), maComment(rComment), maRepeatComment(rRepeatComment) {}
+ Impl( sal_uInt16 nId, sal_Int32 nViewShellId, const OUString& rComment, const OUString& rRepeatComment ) :
+ mnId(nId), mnViewShellId(nViewShellId), maComment(rComment), maRepeatComment(rRepeatComment) {}
};
sal_uInt16 SfxListUndoAction::GetId() const
@@ -1283,6 +1285,11 @@ OUString SfxListUndoAction::GetComment() const
return mpImpl->maComment;
}
+sal_Int32 SfxListUndoAction::GetViewShellId() const
+{
+ return mpImpl->mnViewShellId;
+}
+
void SfxListUndoAction::SetComment(const OUString& rComment)
{
mpImpl->maComment = rComment;
@@ -1297,8 +1304,9 @@ SfxListUndoAction::SfxListUndoAction(
const OUString &rComment,
const OUString &rRepeatComment,
sal_uInt16 nId,
+ sal_Int32 nViewShellId,
SfxUndoArray *pFather ) :
- mpImpl(new Impl(nId, rComment, rRepeatComment))
+ mpImpl(new Impl(nId, nViewShellId, rComment, rRepeatComment))
{
pFatherUndoArray = pFather;
nMaxUndoActions = USHRT_MAX;