diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-16 09:19:03 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-16 09:20:23 +0100 |
commit | c8b36dcde79588ec71957117be1c19f3ddaec647 (patch) | |
tree | a9351652564ba230d584ae554b96f5566f9fe129 /sw/source | |
parent | 8314c3bda34102053905c751938984b5212b836f (diff) |
sw: clean up remaining format collection dumpers
Change-Id: I00833847c3c9410312205751a89d319a3143d516
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 52 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/txtnode/chrfmt.cxx | 19 |
4 files changed, 43 insertions, 52 deletions
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index bd2438d42ecd..24f35e4311dc 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -249,58 +249,6 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w ) const // writer.endElement(); - it is a start node, so don't end, will make xml better nested } -void SwFrmFmts::dumpAsXml(xmlTextWriterPtr w, const char* pName) const -{ - WriterHelper writer(w); - if (size()) - { - writer.startElement(pName); - for (size_t i = 0; i < size(); ++i) - { - if (const SwFrmFmt* pFmt = GetFmt(i)) - pFmt->dumpAsXml(writer); - } - writer.endElement(); - } -} - -void SwCharFmts::dumpAsXml(xmlTextWriterPtr w) const -{ - WriterHelper writer(w); - if (size()) - { - writer.startElement("swcharfmts"); - for (size_t i = 0; i < size(); ++i) - { - const SwCharFmt* pFmt = GetFmt(i); - writer.startElement("swcharfmt"); - OString aName = OUStringToOString(pFmt->GetName(), RTL_TEXTENCODING_UTF8); - writer.writeFormatAttribute("name", "%s", BAD_CAST(aName.getStr())); - - pFmt->GetAttrSet().dumpAsXml(w); - writer.endElement(); - } - writer.endElement(); - } -} - -void SwSectionFmts::dumpAsXml(xmlTextWriterPtr w) const -{ - WriterHelper writer(w); - if (size()) - { - writer.startElement("swsectionfmts"); - for (size_t i = 0; i < size(); ++i) - { - const SwSectionFmt* pFmt = GetFmt(i); - writer.startElement("swsectionfmt"); - pFmt->GetAttrSet().dumpAsXml(w); - writer.endElement(); - } - writer.endElement(); - } -} - void SwTxtNode::dumpAsXml( xmlTextWriterPtr w ) const { WriterHelper writer( w ); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index e1a90b723067..37289e46c1b2 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1086,6 +1086,22 @@ SwSectionFmt::MakeUnoObject() return xMeta; } +void SwSectionFmt::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swSectionFmt")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr())); + GetAttrSet().dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + +void SwSectionFmts::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swSectionFmts")); + for (size_t i = 0; i < size(); ++i) + GetFmt(i)->dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + // Method to break section links inside a linked section static void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd ) { diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 083f884b9d78..961b70f5b7b3 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2835,6 +2835,14 @@ void SwFrmFmt::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterEndElement(pWriter); } +void SwFrmFmts::dumpAsXml(xmlTextWriterPtr pWriter, const char* pName) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST(pName)); + for (size_t i = 0; i < size(); ++i) + GetFmt(i)->dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + // class SwFlyFrmFmt // Partially implemented inline in hxx diff --git a/sw/source/core/txtnode/chrfmt.cxx b/sw/source/core/txtnode/chrfmt.cxx index 86359ff7740e..9557ba8145fe 100644 --- a/sw/source/core/txtnode/chrfmt.cxx +++ b/sw/source/core/txtnode/chrfmt.cxx @@ -17,8 +17,27 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <libxml/xmlwriter.h> + #include <charfmt.hxx> +#include <docary.hxx> TYPEINIT1( SwCharFmt, SwFmt ); //rtti fuer SwCharFmt +void SwCharFmt::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swCharFmt")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr())); + GetAttrSet().dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + +void SwCharFmts::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swCharFmts")); + for (size_t i = 0; i < size(); ++i) + GetFmt(i)->dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |