diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-11-03 13:15:59 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-11-03 15:35:27 +0100 |
commit | ec7d261772d55c5328d0ca2c87f1f9399882ecd5 (patch) | |
tree | 8c4cc2befc5f65bf0f8329a5926e6a81bec43634 /sw | |
parent | 99cfc0f8a321c3fd3ef1a49d669ebc5744dbf606 (diff) |
sw doc model dump: show parameters of fieldmarks
Change-Id: I3596df5736620488948cc3a138d63a0cb9676ee8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 122bcd4ef4ea..90e356b64fd2 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(); |