summaryrefslogtreecommitdiff
path: root/svl/source/undo/undo.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/undo/undo.cxx')
-rw-r--r--svl/source/undo/undo.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 154e8e9ee8fb..def0089a00e2 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -1285,6 +1285,14 @@ void SfxUndoManager::RemoveOldestUndoActions( size_t const i_count )
void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const
{
+ bool bOwns = false;
+ if (!pWriter)
+ {
+ pWriter = xmlNewTextWriterFilename("undo.xml", 0);
+ xmlTextWriterStartDocument(pWriter, nullptr, nullptr, nullptr);
+ bOwns = true;
+ }
+
xmlTextWriterStartElement(pWriter, BAD_CAST("sfxUndoManager"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nUndoActionCount"), BAD_CAST(OString::number(GetUndoActionCount()).getStr()));
@@ -1292,6 +1300,11 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const
GetUndoAction(i)->dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
+ if (bOwns)
+ {
+ xmlTextWriterEndDocument(pWriter);
+ xmlFreeTextWriter(pWriter);
+ }
}
struct SfxListUndoAction::Impl