summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-01-06 09:05:48 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-01-06 09:07:18 +0100
commitde7a5eb44f942054c42157bf9243fb89a1d39368 (patch)
tree953882dd568c6feaa4c38faa7e56792421e6a9ae
parent3b482df3b9dad788855d1591b795a6a5fafe381a (diff)
Factor out XFillColorItem::dumpAsXml() from sw
Change-Id: Idc4c3e00c748fa94f233f2fc5e7c7e9de3a31a22
-rw-r--r--include/svx/xflclit.hxx2
-rw-r--r--svx/source/xoutdev/xattr.cxx8
-rw-r--r--sw/source/core/docnode/nodedump.cxx7
3 files changed, 14 insertions, 3 deletions
diff --git a/include/svx/xflclit.hxx b/include/svx/xflclit.hxx
index d7b39d074f49..74c9d1e8d515 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 fc1625e51ef5..8c3fc6b90582 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 c887f2aaea1d..5a1adcbf9e8e 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;