diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-10 09:14:44 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-10 09:15:05 +0100 |
commit | d857871bcbccd0c69645e5e963d106362f40382e (patch) | |
tree | 9d96f09b17e9dca9ab388d03d7aad41d0944d81c /sw | |
parent | 8b68841c1482d98bee98de0a60910b93feb8f8b6 (diff) |
Extract SwNodes::dumpAsXml() from nodedump
Change-Id: Ic94fceef0d4291a02bc3da7bcbeeb2c19670200c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/ndarr.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 10 |
3 files changed, 11 insertions, 13 deletions
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index a4c83c665b7c..4384bcfa4665 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 127701bb831d..f291c7896a84 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 0530e2ce91f1..97fd7e0a5c06 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: */ |