diff options
-rw-r--r-- | include/svx/svdobj.hxx | 2 | ||||
-rw-r--r-- | svx/Library_svxcore.mk | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 17 |
4 files changed, 23 insertions, 15 deletions
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 5a5ab9b55ad6..30c3961b3a9b 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -961,6 +961,8 @@ public: OString stringify() const; + void dumpAsXml(struct _xmlTextWriter* pWriter) const; + protected: // Sets a new UNO shape // diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 420a6b8c4487..39d6be5686c6 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -87,6 +87,7 @@ $(eval $(call gb_Library_use_externals,svxcore,\ icu_headers \ mesa_headers \ glew \ + libxml2 \ )) ifeq ($(OS),MACOSX) diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 470881f730be..ac2fff182596 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -37,6 +37,7 @@ #include <drawinglayer/processor2d/linegeometryextractor2d.hxx> #include <editeng/editeng.hxx> #include <editeng/eeitem.hxx> +#include <editeng/outlobj.hxx> #include <math.h> #include <sfx2/objface.hxx> #include <sfx2/objsh.hxx> @@ -133,6 +134,7 @@ #include <svdobjuserdatalist.hxx> #include <boost/scoped_ptr.hpp> +#include <libxml/xmlwriter.h> using namespace ::com::sun::star; @@ -1750,6 +1752,22 @@ OString SdrObject::stringify() const return aString.makeStringAndClear(); } +void SdrObject::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("sdrObject")); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*this).name())); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("name"), "%s", BAD_CAST(GetName().toUtf8().getStr())); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("title"), "%s", BAD_CAST(GetTitle().toUtf8().getStr())); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("description"), "%s", BAD_CAST(GetDescription().toUtf8().getStr())); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("nOrdNum"), "%" SAL_PRIuUINT32, GetOrdNumDirect()); + + if (const OutlinerParaObject* pOutliner = GetOutlinerParaObject()) + pOutliner->dumpAsXml(pWriter); + + xmlTextWriterEndElement(pWriter); +} + bool SdrObject::BegTextEdit(SdrOutliner& /*rOutl*/) { return false; diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 87a2ae4819be..7e7795cc7834 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -147,21 +147,8 @@ void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel) const size_t nObjCount = pPage->GetObjCount(); for (size_t i = 0; i < nObjCount; ++i) { - const SdrObject* pObject = pPage->GetObj(i); - writer.startElement("sdrObject"); - writer.writeFormatAttribute("ptr", "%p", pObject); - if (pObject) - { - writer.writeFormatAttribute("symbol", "%s", BAD_CAST(typeid(*pObject).name())); - writer.writeFormatAttribute("name", "%s", BAD_CAST(OUStringToOString(pObject->GetName(), RTL_TEXTENCODING_UTF8).getStr())); - writer.writeFormatAttribute("title", "%s", BAD_CAST(OUStringToOString(pObject->GetTitle(), RTL_TEXTENCODING_UTF8).getStr())); - writer.writeFormatAttribute("description", "%s", BAD_CAST(OUStringToOString(pObject->GetDescription(), RTL_TEXTENCODING_UTF8).getStr())); - writer.writeFormatAttribute("nOrdNum", TMP_FORMAT, pObject->GetOrdNumDirect()); - - if (const OutlinerParaObject* pOutliner = pObject->GetOutlinerParaObject()) - pOutliner->dumpAsXml(writer); - } - writer.endElement(); + if (const SdrObject* pObject = pPage->GetObj(i)) + pObject->dumpAsXml(writer); } } writer.endElement(); |