summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-04 11:13:45 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-04 15:33:13 +0100
commitc09fc2c69510cd53da897011192ce1ed727dd12f (patch)
tree61d31956fb0546cecb85811d87250be725a2b765
parent5fa18dc21644f2a719bf39ec948a586fa8837b6a (diff)
sw: include contents of char styles in doc model xml dump
Change-Id: Ie62d808e9b498ef7125d603f20594ab1bb665a50
-rw-r--r--sw/source/core/docnode/nodedump.cxx42
1 files changed, 24 insertions, 18 deletions
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 26aa735e0501..2d0cd2bc6a07 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -24,6 +24,7 @@
#include <svl/intitem.hxx>
#include <editeng/charrotateitem.hxx>
#include <editeng/rsiditem.hxx>
+#include <editeng/fontitem.hxx>
#include <tools/datetimeutils.hxx>
#include <libxml/encoding.h>
@@ -286,24 +287,6 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
// writer.endElement(); - it is a start node, so don't end, will make xml better nested
}
-void SwCharFmts::dumpAsXml(xmlTextWriterPtr w)
-{
- WriterHelper writer(w);
- if (size())
- {
- writer.startElement("swcharfmts");
- for (size_t i = 0; i < size(); ++i)
- {
- SwCharFmt* pFmt = static_cast<SwCharFmt*>(GetFmt(i));
- writer.startElement("swcharfmt");
- OString aName = OUStringToOString(pFmt->GetName(), RTL_TEXTENCODING_UTF8);
- writer.writeFormatAttribute("name", "%s", BAD_CAST(aName.getStr()));
- writer.endElement();
- }
- writer.endElement();
- }
-}
-
void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
{
SfxItemIter aIter(*pSet);
@@ -333,6 +316,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_CHRATR_ROTATE: pWhich = "character rotation"; oValue = OString::number(static_cast<const SvxCharRotateItem*>(pItem)->GetValue()); break;
case RES_PARATR_OUTLINELEVEL: pWhich = "paragraph outline level"; oValue = OString::number(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); break;
case RES_PARATR_NUMRULE: pWhich = "paragraph numbering rule"; oValue = OUStringToOString(static_cast<const SwNumRuleItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8); break;
+ case RES_CHRATR_FONT: pWhich = "character font"; oValue = OUStringToOString(static_cast<const SvxFontItem*>(pItem)->GetFamilyName(), RTL_TEXTENCODING_UTF8); break;
+ case RES_CHRATR_BACKGROUND: pWhich = "character background"; break;
+ case RES_CHRATR_CTL_FONT: pWhich = "character ctl font"; break;
}
if (pWhich)
writer.writeFormatAttribute("which", "%s", BAD_CAST(pWhich));
@@ -343,6 +329,26 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
}
}
+void SwCharFmts::dumpAsXml(xmlTextWriterPtr w)
+{
+ WriterHelper writer(w);
+ if (size())
+ {
+ writer.startElement("swcharfmts");
+ for (size_t i = 0; i < size(); ++i)
+ {
+ SwCharFmt* pFmt = static_cast<SwCharFmt*>(GetFmt(i));
+ writer.startElement("swcharfmt");
+ OString aName = OUStringToOString(pFmt->GetName(), RTL_TEXTENCODING_UTF8);
+ writer.writeFormatAttribute("name", "%s", BAD_CAST(aName.getStr()));
+
+ lcl_dumpSfxItemSet(writer, &pFmt->GetAttrSet());
+ writer.endElement();
+ }
+ writer.endElement();
+ }
+}
+
void SwTxtFmtColls::dumpAsXml(xmlTextWriterPtr w)
{
WriterHelper writer(w);