[Libreoffice-commits] core.git: sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Dec 5 08:50:10 PST 2014
sw/inc/frmfmt.hxx | 2 +
sw/source/core/docnode/nodedump.cxx | 50 ++++++++++++++++++++----------------
2 files changed, 30 insertions(+), 22 deletions(-)
New commits:
commit dd40936c9ccb76c17eac038eda4aa142ed13b129
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Dec 5 17:14:18 2014 +0100
Factor out SwFrmFmt::dumpAsXml() from SwFrmFmts::dumpAsXml()
Change-Id: I494e6cd44087924d4b1f4fb9fcc599040d64390c
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index e73f6bd..e4c6e58 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 705e34a..6007a3f 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);
More information about the Libreoffice-commits
mailing list