diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-13 09:09:40 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-13 09:10:03 +0100 |
commit | e6b2860e88fa89b4ce7c9fdc7026dc1daf0fa700 (patch) | |
tree | d9c754a3eb07672bb4a48459bf8b7a24de7cb45d /sw | |
parent | 1e970284c069721dfa968bd262df4bcc516bc47f (diff) |
Extract SwTxtFmtColl::dumpAsXml() from docnode
Change-Id: I3ffe83afa0e0e6f181f75319af3d5cbcc78de395
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/fmtcol.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/fmtcol.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 10 |
3 files changed, 13 insertions, 9 deletions
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index ce65a1c9505d..4d4b047c9897 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -130,6 +130,8 @@ public: } bool AreListLevelIndentsApplicable() const; + + void dumpAsXml(struct _xmlTextWriter* pWriter) const; }; class SwGrfFmtColl: public SwFmtColl diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index ac80f02db507..8f6af9c8181f 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <libxml/xmlwriter.h> + #include <sal/macros.h> #include <hintids.hxx> #include <editeng/ulspitem.hxx> @@ -462,6 +464,14 @@ bool SwTxtFmtColl::AreListLevelIndentsApplicable() const return bAreListLevelIndentsApplicable; } +void SwTxtFmtColl::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swTxtFmtColl")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr())); + GetAttrSet().dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + //FEATURE::CONDCOLL SwCollCondition::SwCollCondition( SwTxtFmtColl* pColl, sal_uLong nMasterCond, diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 3eed9fa06202..e2910b094e8b 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -308,15 +308,7 @@ void SwTxtFmtColls::dumpAsXml(xmlTextWriterPtr w) const { writer.startElement("swtxtfmtcolls"); for (size_t i = 0; i < size(); ++i) - { - const SwTxtFmtColl* pColl = GetFmt(i); - writer.startElement("swtxtfmtcoll"); - OString aName = OUStringToOString(pColl->GetName(), RTL_TEXTENCODING_UTF8); - writer.writeFormatAttribute("name", "%s", BAD_CAST(aName.getStr())); - - pColl->GetAttrSet().dumpAsXml(w); - writer.endElement(); - } + GetFmt(i)->dumpAsXml(w); writer.endElement(); } } |