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

Miklos Vajna vmiklos at collabora.co.uk
Tue Mar 4 06:33:36 PST 2014


 sw/source/core/docnode/nodedump.cxx |   42 ++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 18 deletions(-)

New commits:
commit c09fc2c69510cd53da897011192ce1ed727dd12f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Mar 4 11:13:45 2014 +0100

    sw: include contents of char styles in doc model xml dump
    
    Change-Id: Ie62d808e9b498ef7125d603f20594ab1bb665a50

diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 26aa735..2d0cd2b 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);


More information about the Libreoffice-commits mailing list