[Libreoffice-commits] core.git: include/svl svl/Library_svl.mk svl/source sw/source

Miklos Vajna vmiklos at collabora.co.uk
Sun Dec 14 13:33:45 PST 2014


 include/svl/intitem.hxx             |    2 ++
 svl/Library_svl.mk                  |    1 +
 svl/source/items/intitem.cxx        |    8 ++++++++
 sw/source/core/docnode/nodedump.cxx |    4 +++-
 4 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 68b8f008c8893b6b7d2314c21679bf2dbcd1b4e5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sun Dec 14 22:18:11 2014 +0100

    Factor out SfxUInt16Item::dumpAsXml() from sw
    
    Change-Id: Ia58bed9c4a0be4b909789e8bdcd64f06230c0f43

diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx
index bea485b..fea545b 100644
--- a/include/svl/intitem.hxx
+++ b/include/svl/intitem.hxx
@@ -114,6 +114,8 @@ public:
 
     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
     { return new SfxUInt16Item(*this); }
+
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 };
 
 
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index 3641385..0754157 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_Library_Library,svl))
 $(eval $(call gb_Library_use_externals,svl,\
     boost_headers \
     mdds_headers \
+    libxml2 \
 ))
 
 $(eval $(call gb_Library_set_componentfile,svl,svl/util/svl))
diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx
index f71c72e..a9405d7 100644
--- a/svl/source/items/intitem.cxx
+++ b/svl/source/items/intitem.cxx
@@ -24,6 +24,7 @@
 #include <tools/bigint.hxx>
 #include <tools/stream.hxx>
 #include <svl/metitem.hxx>
+#include <libxml/xmlwriter.h>
 
 
 //  class SfxByteItem
@@ -141,6 +142,13 @@ SfxFieldUnit SfxInt16Item::GetUnit() const
 
 TYPEINIT1_AUTOFACTORY(SfxUInt16Item, CntUInt16Item);
 
+void SfxUInt16Item::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("sfxUInt16Item"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
 
 
 //  class SfxInt32Item
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index b2053cd..7104951 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -407,6 +407,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
             case RES_CHRATR_ROTATE:
                 static_cast<const SvxCharRotateItem*>(pItem)->dumpAsXml(writer);
                 break;
+            case RES_PARATR_OUTLINELEVEL:
+                static_cast<const SfxUInt16Item*>(pItem)->dumpAsXml(writer);
+                break;
             default: bDone = false; break;
         }
         if (bDone)
@@ -421,7 +424,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
         boost::optional<OString> oValue;
         switch (pItem->Which())
         {
-            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;


More information about the Libreoffice-commits mailing list