[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Nov 3 06:36:06 PST 2014
sw/source/core/docnode/nodedump.cxx | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
New commits:
commit ec7d261772d55c5328d0ca2c87f1f9399882ecd5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Nov 3 13:15:59 2014 +0100
sw doc model dump: show parameters of fieldmarks
Change-Id: I3596df5736620488948cc3a138d63a0cb9676ee8
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 122bcd4..90e356b 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -55,6 +55,7 @@
#include <libxml/xmlwriter.h>
#include <boost/optional.hpp>
#include <rtl/strbuf.hxx>
+#include <comphelper/anytostring.hxx>
using namespace com::sun::star;
@@ -244,6 +245,26 @@ void MarkManager::dumpAsXml( xmlTextWriterPtr w ) const
writer.writeFormatAttribute("endOffset", TMP_FORMAT_I32, pMark->GetMarkEnd().nContent.GetIndex());
OString txt8 = OUStringToOString(pMark->GetName(), RTL_TEXTENCODING_UTF8);
writer.writeFormatAttribute("name", "%s", BAD_CAST( txt8.getStr()));
+
+ if (sw::mark::IFieldmark* pFieldmark = dynamic_cast<sw::mark::IFieldmark*>(pMark.get()))
+ {
+ sw::mark::IFieldmark::parameter_map_t* pParameters = pFieldmark->GetParameters();
+ if (pParameters)
+ {
+ writer.startElement("parameters");
+ for (sw::mark::IFieldmark::parameter_map_t::iterator parameter = pParameters->begin(); parameter != pParameters->end(); ++parameter)
+ {
+ writer.startElement("parameter");
+ OString aName = OUStringToOString(parameter->first, RTL_TEXTENCODING_UTF8);
+ writer.writeFormatAttribute("name", "%s", BAD_CAST(aName.getStr()));
+ OString aValue = OUStringToOString(comphelper::anyToString(parameter->second), RTL_TEXTENCODING_UTF8);
+ writer.writeFormatAttribute("value", "%s", BAD_CAST(aValue.getStr()));
+ writer.endElement();
+ }
+ writer.endElement();
+ }
+ }
+
writer.endElement();
}
writer.endElement();
More information about the Libreoffice-commits
mailing list