[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at suse.cz
Fri Feb 15 07:09:08 PST 2013
sw/source/core/docnode/nodedump.cxx | 25 +++++++++++++++++++++++++
sw/source/core/inc/MarkManager.hxx | 1 +
2 files changed, 26 insertions(+)
New commits:
commit ba30ed10c4a322f4a5fb7873cad9eb857477672a
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Fri Feb 15 16:07:03 2013 +0100
sw: include fieldmarks in document model dump
Change-Id: I5924ae824f87f796c808d56bf13d3dfd143a8e0a
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 9db2f9b..4c92e6a 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -28,6 +28,7 @@
#include "doc.hxx"
#include "ndtxt.hxx"
+#include "MarkManager.hxx"
#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
@@ -115,9 +116,33 @@ void SwDoc::dumpAsXml( xmlTextWriterPtr w )
writer.startElement( "doc" );
writer.writeFormatAttribute( "ptr", "%p", this );
m_pNodes->dumpAsXml( writer );
+ pMarkManager->dumpAsXml( writer );
writer.endElement();
}
+namespace sw {
+namespace mark {
+void MarkManager::dumpAsXml( xmlTextWriterPtr w )
+{
+ WriterHelper writer(w);
+ writer.startElement("markManager");
+ writer.startElement("fieldmarks");
+ for (const_iterator_t it = m_vFieldmarks.begin(); it != m_vFieldmarks.end(); ++it)
+ {
+ pMark_t pMark = *it;
+ writer.startElement("fieldmark");
+ writer.writeFormatAttribute("startNode", "%lu", pMark->GetMarkStart().nNode.GetIndex());
+ writer.writeFormatAttribute("startOffset", "%d", pMark->GetMarkStart().nContent.GetIndex());
+ writer.writeFormatAttribute("endNode", "%lu", pMark->GetMarkEnd().nNode.GetIndex());
+ writer.writeFormatAttribute("endOffset", "%d", pMark->GetMarkEnd().nContent.GetIndex());
+ writer.endElement();
+ }
+ writer.endElement();
+ writer.endElement();
+}
+} // namespace mark
+} // namespace sw
+
void SwNodes::dumpAsXml( xmlTextWriterPtr w )
{
WriterHelper writer( w );
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index 2c2bf85..2f17661 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -77,6 +77,7 @@ namespace sw {
virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& rPos) const;
virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& rPos) const;
+ void dumpAsXml(xmlTextWriterPtr w);
private:
// make names
::rtl::OUString getUniqueMarkName(const ::rtl::OUString& rName) const;
More information about the Libreoffice-commits
mailing list