Kaydet (Commit) de7a5eb4 authored tarafından Miklos Vajna's avatar Miklos Vajna

Factor out XFillColorItem::dumpAsXml() from sw

Change-Id: Idc4c3e00c748fa94f233f2fc5e7c7e9de3a31a22
üst 3b482df3
...@@ -49,6 +49,8 @@ public: ...@@ -49,6 +49,8 @@ public:
SfxMapUnit eCoreMetric, SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric, SfxMapUnit ePresMetric,
OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE; OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
}; };
#endif #endif
......
...@@ -2259,6 +2259,14 @@ bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 ...@@ -2259,6 +2259,14 @@ bool XFillColorItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8
return true; 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); TYPEINIT1_AUTOFACTORY(XSecondaryFillColorItem, XColorItem);
XSecondaryFillColorItem::XSecondaryFillColorItem(const OUString& rName, const Color& rTheColor) : XSecondaryFillColorItem::XSecondaryFillColorItem(const OUString& rName, const Color& rTheColor) :
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <svx/svdpage.hxx> #include <svx/svdpage.hxx>
#include <svx/svdmodel.hxx> #include <svx/svdmodel.hxx>
#include <svx/xfillit0.hxx> #include <svx/xfillit0.hxx>
#include <svx/xflclit.hxx>
#include <tools/datetimeutils.hxx> #include <tools/datetimeutils.hxx>
#include <libxml/encoding.h> #include <libxml/encoding.h>
...@@ -455,6 +456,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -455,6 +456,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case XATTR_FILLSTYLE: case XATTR_FILLSTYLE:
static_cast<const XFillStyleItem*>(pItem)->dumpAsXml(writer); static_cast<const XFillStyleItem*>(pItem)->dumpAsXml(writer);
break; break;
case XATTR_FILLCOLOR:
static_cast<const XFillColorItem*>(pItem)->dumpAsXml(writer);
break;
default: bDone = false; break; default: bDone = false; break;
} }
if (bDone) if (bDone)
...@@ -469,9 +473,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -469,9 +473,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue; boost::optional<OString> oValue;
switch (pItem->Which()) switch (pItem->Which())
{ {
case XATTR_FILLCOLOR:
pWhich = "fill color";
break;
case XATTR_FILLBITMAP: case XATTR_FILLBITMAP:
pWhich = "fill bitmap"; pWhich = "fill bitmap";
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment