summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-07-29 13:58:07 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-01 09:45:14 +0200
commitd2f6a33b5d3126493c8ba848dfc9f4d08b34e13c (patch)
tree85cd4639c647709a21a7429f0108b55edb772224
parentf89209f23c1541fec83b6f7d3e67c5b9bc3c5678 (diff)
svl: add SfxUndoAction::GetViewShellId()
In preparation of a Writer version that overrides this and remembers which view shell introduced which action. Change-Id: I4970f8ce9c56f1b57ab1ae92f3ea8be804ca27bf Reviewed-on: https://gerrit.libreoffice.org/27682 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 7494466e43daa4d071224f401267e2b6fd4222aa)
-rw-r--r--include/svl/undo.hxx2
-rw-r--r--svl/source/undo/undo.cxx5
2 files changed, 7 insertions, 0 deletions
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx
index 0dce8073f855..94322f979036 100644
--- a/include/svl/undo.hxx
+++ b/include/svl/undo.hxx
@@ -66,6 +66,8 @@ public:
virtual OUString GetComment() const;
virtual OUString GetRepeatComment(SfxRepeatTarget&) const;
virtual sal_uInt16 GetId() const;
+ /// ID of the view shell that created this undo action.
+ virtual sal_Int32 GetViewShellId() const;
virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const;
private:
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index e015e0a6e328..cab05023e6a4 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -84,6 +84,10 @@ sal_uInt16 SfxUndoAction::GetId() const
return 0;
}
+sal_Int32 SfxUndoAction::GetViewShellId() const
+{
+ return -1;
+}
OUString SfxUndoAction::GetRepeatComment(SfxRepeatTarget&) const
{
@@ -137,6 +141,7 @@ void SfxUndoAction::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("symbol"), BAD_CAST(typeid(*this).name()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("comment"), BAD_CAST(GetComment().toUtf8().getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("viewShellId"), BAD_CAST(OString::number(GetViewShellId()).getStr()));
xmlTextWriterEndElement(pWriter);
}