summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-27 08:04:28 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-27 08:04:59 +0100
commit855c94a46a8810780dacce178b533ab6ceb4d19b (patch)
tree3a16fd7fff79b2ffc5c32828bb5e573df1692a07
parent90fe751ab381cf59e87b79d921b3773567774af2 (diff)
Factor out OutlinerParaObject::dumpAsXml() from SwDoc::dumpAsXml()
Change-Id: I5e805aa98f643b5a034cdeadb4718af528af022c
-rw-r--r--editeng/source/outliner/outlobj.cxx9
-rw-r--r--include/editeng/outlobj.hxx2
-rw-r--r--sw/source/core/docnode/nodedump.cxx8
3 files changed, 13 insertions, 6 deletions
diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx
index a4dcc67f8009..02094aea2a02 100644
--- a/editeng/source/outliner/outlobj.cxx
+++ b/editeng/source/outliner/outlobj.cxx
@@ -33,6 +33,7 @@
#include <tools/stream.hxx>
#include <boost/intrusive_ptr.hpp>
+#include <libxml/xmlwriter.h>
/**
* This is the guts of OutlinerParaObject, refcounted and shared among
@@ -278,4 +279,12 @@ void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const OUString& rNewN
}
}
+void OutlinerParaObject::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("outlinerParaObject"));
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+ GetTextObject().dumpAsXml(pWriter);
+ xmlTextWriterEndElement(pWriter);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/outlobj.hxx b/include/editeng/outlobj.hxx
index c57397e8cc02..39c2b3ea9e9e 100644
--- a/include/editeng/outlobj.hxx
+++ b/include/editeng/outlobj.hxx
@@ -76,6 +76,8 @@ public:
const OUString& rNewName);
void SetStyleSheets(sal_uInt16 nLevel, const OUString& rNewName,
const SfxStyleFamily& rNewFamily);
+
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
#endif
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 9268d7f9b1cb..87a2ae4819be 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -158,12 +158,8 @@ void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel)
writer.writeFormatAttribute("description", "%s", BAD_CAST(OUStringToOString(pObject->GetDescription(), RTL_TEXTENCODING_UTF8).getStr()));
writer.writeFormatAttribute("nOrdNum", TMP_FORMAT, pObject->GetOrdNumDirect());
- const OutlinerParaObject* pOutliner = pObject->GetOutlinerParaObject();
- writer.startElement("outliner");
- writer.writeFormatAttribute("ptr", "%p", pOutliner);
- if (pOutliner)
- pOutliner->GetTextObject().dumpAsXml(writer);
- writer.endElement();
+ if (const OutlinerParaObject* pOutliner = pObject->GetOutlinerParaObject())
+ pOutliner->dumpAsXml(writer);
}
writer.endElement();
}