diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-11-28 09:05:16 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-11-28 11:24:49 +0100 |
commit | c25aa2ad4306d011df03100aa54d0b3b72a7a9f5 (patch) | |
tree | 6449cea564250762b8740b83e2c668e43102046a /svx | |
parent | 1e514c8da8e37fc3cb26af6ddaf95a3ed8093a41 (diff) |
Factor out SdrObject::dumpAsXml() from SwDoc::dumpAsXml()
Change-Id: I043f740c73f1b39d81383f4f1eab2aae009ac2ba
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svxcore.mk | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 18 |
2 files changed, 19 insertions, 0 deletions
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; |