summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-05 17:14:18 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-05 17:49:29 +0100
commitdd40936c9ccb76c17eac038eda4aa142ed13b129 (patch)
treedaf690aabdea5dacf6f342293f9da11b58d3cf88 /sw
parent71bed3b736957d09a5379725ce5c97f5166ea30d (diff)
Factor out SwFrmFmt::dumpAsXml() from SwFrmFmts::dumpAsXml()
Change-Id: I494e6cd44087924d4b1f4fb9fcc599040d64390c
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/frmfmt.hxx2
-rw-r--r--sw/source/core/docnode/nodedump.cxx50
2 files changed, 30 insertions, 22 deletions
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index e73f6bd22cf3..e4c6e58b61ad 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -142,6 +142,8 @@ public:
//UUUU Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage
virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const SAL_OVERRIDE;
virtual bool supportsFullDrawingLayerFillAttributeSet() const SAL_OVERRIDE;
+
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
// The FlyFrame-Format
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 705e34a53603..6007a3fec151 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -640,33 +640,39 @@ void SwFrmFmts::dumpAsXml(xmlTextWriterPtr w, const char* pName) const
writer.startElement(pName);
for (size_t i = 0; i < size(); ++i)
{
- const SwFrmFmt* pFmt = GetFmt(i);
- writer.startElement("swfrmfmt");
- OString aName = OUStringToOString(pFmt->GetName(), RTL_TEXTENCODING_UTF8);
- writer.writeFormatAttribute("ptr", "%p", pFmt);
- writer.writeFormatAttribute("name", "%s", BAD_CAST(aName.getStr()));
-
- writer.writeFormatAttribute("whichId", TMP_FORMAT, pFmt->Which());
- const char* pWhich = 0;
- switch (pFmt->Which())
- {
- case RES_FLYFRMFMT:
- pWhich = "fly frame format";
- break;
- case RES_DRAWFRMFMT:
- pWhich = "draw frame format";
- break;
- }
- if (pWhich)
- writer.writeFormatAttribute("which", "%s", BAD_CAST(pWhich));
-
- lcl_dumpSfxItemSet(writer, &pFmt->GetAttrSet());
- writer.endElement();
+ if (const SwFrmFmt* pFmt = GetFmt(i))
+ pFmt->dumpAsXml(writer);
}
writer.endElement();
}
}
+void SwFrmFmt::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("swFrmFmt"));
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
+ xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
+
+ const char* pWhich = 0;
+ switch (Which())
+ {
+ case RES_FLYFRMFMT:
+ pWhich = "fly frame format";
+ break;
+ case RES_DRAWFRMFMT:
+ pWhich = "draw frame format";
+ break;
+ }
+ if (pWhich)
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("which"), BAD_CAST(pWhich));
+
+ WriterHelper w(pWriter);
+ lcl_dumpSfxItemSet(w, &GetAttrSet());
+
+ xmlTextWriterEndElement(pWriter);
+}
+
void SwCharFmts::dumpAsXml(xmlTextWriterPtr w) const
{
WriterHelper writer(w);