[Libreoffice-commits] core.git: sw/inc sw/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Feb 13 00:10:34 PST 2015


 sw/inc/fmtcol.hxx                   |    2 ++
 sw/source/core/doc/fmtcol.cxx       |   10 ++++++++++
 sw/source/core/docnode/nodedump.cxx |   10 +---------
 3 files changed, 13 insertions(+), 9 deletions(-)

New commits:
commit e6b2860e88fa89b4ce7c9fdc7026dc1daf0fa700
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Feb 13 09:09:40 2015 +0100

    Extract SwTxtFmtColl::dumpAsXml() from docnode
    
    Change-Id: I3ffe83afa0e0e6f181f75319af3d5cbcc78de395

diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index ce65a1c..4d4b047 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 ac80f02..8f6af9c 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 3eed9fa..e2910b0 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();
     }
 }


More information about the Libreoffice-commits mailing list