[Libreoffice-commits] core.git: editeng/source include/editeng sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Nov 26 23:05:26 PST 2014
editeng/source/outliner/outlobj.cxx | 9 +++++++++
include/editeng/outlobj.hxx | 2 ++
sw/source/core/docnode/nodedump.cxx | 8 ++------
3 files changed, 13 insertions(+), 6 deletions(-)
New commits:
commit 855c94a46a8810780dacce178b533ab6ceb4d19b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Nov 27 08:04:28 2014 +0100
Factor out OutlinerParaObject::dumpAsXml() from SwDoc::dumpAsXml()
Change-Id: I5e805aa98f643b5a034cdeadb4718af528af022c
diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx
index a4dcc67..02094ae 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 c57397e..39c2b3e 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 9268d7f..87a2ae4 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();
}
More information about the Libreoffice-commits
mailing list