Factor out XFillColorItem::dumpAsXml() from sw

Change-Id: Idc4c3e00c748fa94f233f2fc5e7c7e9de3a31a22
diff --git a/include/svx/xflclit.hxx b/include/svx/xflclit.hxx
index d7b39d0..74c9d1e 100644
--- a/include/svx/xflclit.hxx
+++ b/include/svx/xflclit.hxx
@@ -49,6 +49,8 @@ public:
                                    SfxMapUnit eCoreMetric,
                                    SfxMapUnit ePresMetric,
                                    OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;

    void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};

#endif
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index fc1625e..8c3fc6b 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -2259,6 +2259,14 @@ bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8
    return true;
}

void XFillColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
    xmlTextWriterStartElement(pWriter, BAD_CAST("xFillColorItem"));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(GetColorValue().AsRGBHexString().toUtf8().getStr()));
    xmlTextWriterEndElement(pWriter);
}

TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem);

XSecondaryFillColorItem::XSecondaryFillColorItem(const OUString& rName, const Color& rTheColor) :
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index c887f2a..5a1adcb 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -53,6 +53,7 @@
#include <svx/svdpage.hxx>
#include <svx/svdmodel.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xflclit.hxx>
#include <tools/datetimeutils.hxx>

#include <libxml/encoding.h>
@@ -455,6 +456,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
            case XATTR_FILLSTYLE:
                static_cast<const XFillStyleItem*>(pItem)->dumpAsXml(writer);
                break;
            case XATTR_FILLCOLOR:
                static_cast<const XFillColorItem*>(pItem)->dumpAsXml(writer);
                break;
            default: bDone = false; break;
        }
        if (bDone)
@@ -469,9 +473,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
        boost::optional<OString> oValue;
        switch (pItem->Which())
        {
            case XATTR_FILLCOLOR:
                pWhich = "fill color";
                break;
            case XATTR_FILLBITMAP:
                pWhich = "fill bitmap";
                break;