diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-31 18:09:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-31 18:09:25 +0100 |
commit | e4b0d63c134e7833db562f4eef93bbf828ea1b9d (patch) | |
tree | acdd48c6a14d27b299a3c067f73b6091e285661a /svl/source/undo | |
parent | d2a6d6a1a05337dbb733a9a3d4926a5c6d6cd8cd (diff) |
Extract SfxUndoAction::dumpAsXml() from sw
Change-Id: I7ec2071150c03b61f3f681dbd26968ae3c535742
Diffstat (limited to 'svl/source/undo')
-rw-r--r-- | svl/source/undo/undo.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index 772dd43af580..1fcc6497ff5f 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -24,6 +24,7 @@ #include <osl/mutex.hxx> #include <comphelper/flagguard.hxx> #include <tools/diagnose_ex.h> +#include <libxml/xmlwriter.h> #include <vector> #include <list> @@ -135,6 +136,14 @@ bool SfxUndoAction::CanRepeat(SfxRepeatTarget&) const return true; } +void SfxUndoAction::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("sfxUndoAction")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("symbol"), BAD_CAST(typeid(*this).name())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("comment"), BAD_CAST(GetComment().toUtf8().getStr())); + xmlTextWriterEndElement(pWriter); +} + struct MarkedUndoAction { SfxUndoAction* pAction; @@ -1372,6 +1381,18 @@ bool SfxListUndoAction::Merge( SfxUndoAction *pNextAction ) return !aUndoActions.empty() && aUndoActions[aUndoActions.size()-1].pAction->Merge( pNextAction ); } +void SfxListUndoAction::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("sfxListUndoAction")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(OString::number(aUndoActions.size()).getStr())); + SfxUndoAction::dumpAsXml(pWriter); + + for (size_t i = 0; i < aUndoActions.size(); ++i) + aUndoActions.GetUndoAction(i)->dumpAsXml(pWriter); + + xmlTextWriterEndElement(pWriter); +} + /** * Creates a LinkAction which points to another UndoManager. * Gets that UndoManagers current Action and sets it as that UndoManager's |