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

Miklos Vajna vmiklos at collabora.co.uk
Tue May 5 09:14:01 PDT 2015


 sw/inc/swdbdata.hxx           |    1 +
 sw/source/core/doc/docfmt.cxx |   12 ++++++++++++
 2 files changed, 13 insertions(+)

New commits:
commit 72cb877e07194f5f9f13dd2716d03f9a50531b1b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue May 5 18:12:20 2015 +0200

    sw doc model xml dump: include SwDBData
    
    Change-Id: I082a9d3ca268d19ac21c28a6b453d457ed27c959

diff --git a/sw/inc/swdbdata.hxx b/sw/inc/swdbdata.hxx
index 2547e3d..6d91e2b 100644
--- a/sw/inc/swdbdata.hxx
+++ b/sw/inc/swdbdata.hxx
@@ -30,6 +30,7 @@ struct SwDBData
     sal_Int32           nCommandType; //com::sun::star::sdb::CommandType
     SwDBData() :
         nCommandType(0){}
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 
     bool operator !=(const SwDBData& rCmp) const
         {return rCmp.sDataSource != sDataSource || rCmp.sCommand != sCommand || rCmp.nCommandType != nCommandType;}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 227b053..c900a08 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1923,6 +1923,7 @@ void SwDoc::dumpAsXml(xmlTextWriterPtr pWriter) const
     xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
 
     m_pNodes->dumpAsXml(pWriter);
+    maDBData.dumpAsXml(pWriter);
     mpMarkManager->dumpAsXml(pWriter);
     m_pUndoManager->dumpAsXml(pWriter);
     getIDocumentFieldsAccess().GetFldTypes()->dumpAsXml(pWriter);
@@ -1949,6 +1950,17 @@ void SwDoc::dumpAsXml(xmlTextWriterPtr pWriter) const
     }
 }
 
+void SwDBData::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("swDBData"));
+
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("sDataSource"), BAD_CAST(sDataSource.toUtf8().getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("sCommand"), BAD_CAST(sCommand.toUtf8().getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nCommandType"), BAD_CAST(OString::number(nCommandType).getStr()));
+
+    xmlTextWriterEndElement(pWriter);
+}
+
 std::set<Color> SwDoc::GetDocColors()
 {
     std::set<Color> aDocColors;


More information about the Libreoffice-commits mailing list