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

Miklos Vajna vmiklos at collabora.co.uk
Tue Feb 10 00:15:31 PST 2015


 sw/inc/ndarr.hxx                    |    2 +-
 sw/source/core/docnode/nodedump.cxx |   12 ------------
 sw/source/core/docnode/nodes.cxx    |   10 ++++++++++
 3 files changed, 11 insertions(+), 13 deletions(-)

New commits:
commit d857871bcbccd0c69645e5e963d106362f40382e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Feb 10 09:14:44 2015 +0100

    Extract SwNodes::dumpAsXml() from nodedump
    
    Change-Id: Ic94fceef0d4291a02bc3da7bcbeeb2c19670200c

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index a4c83c6..4384bcf 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -330,7 +330,7 @@ public:
      * Dumps the entire nodes structure to the given destination (file nodes.xml in the current directory by default)
      * @since 3.5
      */
-    void dumpAsXml( xmlTextWriterPtr writer = NULL ) const;
+    void dumpAsXml( xmlTextWriterPtr pWriter ) const;
 };
 
 
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 127701b..f291c78 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -167,18 +167,6 @@ void SwFldTypes::dumpAsXml( xmlTextWriterPtr w ) const
     writer.endElement();
 }
 
-void SwNodes::dumpAsXml( xmlTextWriterPtr w ) const
-{
-    WriterHelper writer( w );
-    writer.startElement( "swnodes" );
-    writer.writeFormatAttribute( "ptr", "%p", this );
-    for( unsigned int i = 0; i < Count(); ++i )
-    {
-        ( *this )[ i ]->dumpAsXml( writer );
-    }
-    writer.endElement();
-}
-
 void SwNode::dumpAsXml( xmlTextWriterPtr w ) const
 {
     WriterHelper writer( w );
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 0530e2c..97fd7e0 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -19,6 +19,8 @@
 
 #include <stdlib.h>
 
+#include <libxml/xmlwriter.h>
+
 #include <node.hxx>
 #include <doc.hxx>
 #include <IDocumentUndoRedo.hxx>
@@ -2311,4 +2313,12 @@ bool SwNodes::IsDocNodes() const
     return this == &pMyDoc->GetNodes();
 }
 
+void SwNodes::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("swNodes"));
+    for (sal_uLong i = 0; i < Count(); ++i)
+        (*this)[i]->dumpAsXml(pWriter);
+    xmlTextWriterEndElement(pWriter);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list