[Libreoffice-commits] core.git: include/svx svx/source sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Dec 1 00:10:33 PST 2014
include/svx/svdpage.hxx | 2 ++
svx/source/svdraw/svdpage.cxx | 15 +++++++++++++++
sw/source/core/docnode/nodedump.cxx | 15 ++-------------
3 files changed, 19 insertions(+), 13 deletions(-)
New commits:
commit 97d9e5297b563cddb19f9df2682cb3ef23c99229
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Dec 1 09:09:43 2014 +0100
Factor out SdrPage::dumpAsXml() from SwDoc::dumpAsXml()
Change-Id: Ida16087b1d954454c672ddeec78b8dfe0e5a45fe
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 712079d..c737186 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -562,6 +562,8 @@ public:
const sdr::contact::ViewObjectContact& rOriginal,
const sdr::contact::DisplayInfo& rDisplayInfo,
bool bEdit );
+
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
typedef tools::WeakReference< SdrPage > SdrPageWeakRef;
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 46ed346..94139448 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -55,6 +55,7 @@
#include <algorithm>
#include <svl/smplhint.hxx>
#include <rtl/strbuf.hxx>
+#include <libxml/xmlwriter.h>
using namespace ::com::sun::star;
@@ -1822,6 +1823,20 @@ void SdrPage::ActionChanged() const
}
}
+void SdrPage::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("sdrPage"));
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+
+ size_t nObjCount = GetObjCount();
+ for (size_t i = 0; i < nObjCount; ++i)
+ {
+ if (const SdrObject* pObject = pPage->GetObj(i))
+ pObject->dumpAsXml(pWriter);
+ }
+
+ xmlTextWriterEndElement(pWriter);
+}
// sdr::Comment interface
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 7e7795c..97352e9 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -139,19 +139,8 @@ void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel)
writer.writeFormatAttribute("ptr", "%p", pModel);
if (pModel)
{
- const SdrPage* pPage = pModel->GetPage(0);
- writer.startElement("sdrPage");
- writer.writeFormatAttribute("ptr", "%p", pPage);
- if (pPage)
- {
- const size_t nObjCount = pPage->GetObjCount();
- for (size_t i = 0; i < nObjCount; ++i)
- {
- if (const SdrObject* pObject = pPage->GetObj(i))
- pObject->dumpAsXml(writer);
- }
- }
- writer.endElement();
+ if (const SdrPage* pPage = pModel->GetPage(0))
+ pPage->dumpAsXml(writer);
}
writer.endElement();
}
More information about the Libreoffice-commits
mailing list