include/svx/svdmodel.hxx | 2 ++ svx/source/svdraw/svdmodel.cxx | 16 ++++++++++++++++ sw/source/core/docnode/nodedump.cxx | 15 ++------------- 3 files changed, 20 insertions(+), 13 deletions(-)
New commits: commit 1801b559e1234cf1f43a414df38bb47fe81f087a Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Wed Dec 3 09:07:41 2014 +0100 Factor out SdrModel::dumpAsXml() from SwDoc::dumpAsXml() Change-Id: Ic2cc6507390edfd0bc5a38b655a3b652fd5ec33e diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 3e4b31e..037cf60 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -666,6 +666,8 @@ public: This returns false if undo was disabled using EnableUndo( false ) and also during the runtime of the Undo() and Redo() methods. */ bool IsUndoEnabled() const; + + void dumpAsXml(struct _xmlTextWriter* pWriter) const; }; typedef tools::WeakReference< SdrModel > SdrModelWeakRef; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index fe81f4f..f2c0f9e 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -87,6 +87,7 @@ #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <boost/scoped_array.hpp> +#include <libxml/xmlwriter.h> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -2014,6 +2015,21 @@ void SdrModel::SetSdrUndoFactory( SdrUndoFactory* pUndoFactory ) } } +void SdrModel::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("sdrModel")); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + + sal_uInt16 nPageCount = GetPageCount(); + for (sal_uInt16 i = 0; i < nPageCount; ++i) + { + if (const SdrPage* pPage = GetPage(i)) + pPage->dumpAsXml(pWriter); + } + + xmlTextWriterEndElement(pWriter); +} + namespace { class theSdrModelUnoTunnelImplementationId : public rtl::Static< UnoTunnelIdInit, theSdrModelUnoTunnelImplementationId > {}; diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 97352e9..190f753 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -133,18 +133,6 @@ static const char* TMP_FORMAT_I32 = "%" SAL_PRIdINT32; void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet); -void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel) -{ - writer.startElement("sdrModel"); - writer.writeFormatAttribute("ptr", "%p", pModel); - if (pModel) - { - if (const SdrPage* pPage = pModel->GetPage(0)) - pPage->dumpAsXml(writer); - } - writer.endElement(); -} - void SwDoc::dumpAsXml( xmlTextWriterPtr w ) const { WriterHelper writer( w ); @@ -162,7 +150,8 @@ void SwDoc::dumpAsXml( xmlTextWriterPtr w ) const mpNumRuleTbl->dumpAsXml( writer ); getIDocumentRedlineAccess().GetRedlineTbl().dumpAsXml( writer ); getIDocumentRedlineAccess().GetExtraRedlineTbl().dumpAsXml( writer ); - lcl_dumpSdrModel( writer, getIDocumentDrawModelAccess().GetDrawModel() ); + if (const SdrModel* pModel = getIDocumentDrawModelAccess().GetDrawModel()) + pModel->dumpAsXml(writer); writer.startElement("mbModified"); writer.writeFormatAttribute("value", TMP_FORMAT, static_cast<int>(getIDocumentState().IsModified())); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits