diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-04 17:34:41 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-04 17:48:06 +0100 |
commit | a66950bb99069d5133ce28b48816148cc10b15d6 (patch) | |
tree | 3ea48436a0c9eb01b2708a95f84a14b6535e4d8c /sw | |
parent | 0cbe2e92a24be1354f9b058b6584aaed40ddb6ce (diff) |
Extract SwNumRule::dumpAsXml() from docnode
Change-Id: I4104f39227cb42d5cc2013c9ae0f4bb15e0f0f00
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/number.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index ab57814ace09..163eda111042 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -46,6 +46,7 @@ #include <algorithm> #include <unordered_map> +#include <libxml/xmlwriter.h> #include <unotools/saveopt.hxx> @@ -1037,6 +1038,15 @@ void SwNumRule::RemoveParagraphStyle( SwTxtFmtColl& rTxtFmtColl ) } } +void SwNumRule::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swNumRule")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("msName"), BAD_CAST(msName.toUtf8().getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mnPoolFmtId"), BAD_CAST(OString::number(mnPoolFmtId).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mbAutoRuleFlag"), BAD_CAST(OString::boolean(mbAutoRuleFlag).getStr())); + xmlTextWriterEndElement(pWriter); +} + void SwNumRule::GetGrabBagItem(uno::Any& rVal) const { if (mpGrabBagItem.get()) diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index c9aa8674726e..64ea367a0b13 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -373,18 +373,6 @@ void SwTxtFmtColls::dumpAsXml(xmlTextWriterPtr w) const } } -void SwNumRule::dumpAsXml(xmlTextWriterPtr w) const -{ - WriterHelper writer(w); - writer.startElement("swnumrule"); - OString aName = OUStringToOString(GetName(), RTL_TEXTENCODING_UTF8); - writer.writeFormatAttribute("name", "%s", BAD_CAST(aName.getStr())); - writer.writeFormatAttribute("isautorule", TMP_FORMAT, IsAutoRule() ? 1 : 0); - if (GetPoolFmtId() != USHRT_MAX) - writer.writeFormatAttribute("poolfmtid", TMP_FORMAT, GetPoolFmtId()); - writer.endElement(); -} - void SwNumRuleTbl::dumpAsXml(xmlTextWriterPtr w) const { if (!empty()) |