[Libreoffice-commits] core.git: include/svx svx/source sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Jan 7 00:47:19 PST 2015
include/svx/xbtmpit.hxx | 2 ++
include/svx/xit.hxx | 2 ++
svx/source/xoutdev/xattr.cxx | 9 +++++++++
svx/source/xoutdev/xattrbmp.cxx | 12 ++++++++++++
sw/source/core/docnode/nodedump.cxx | 7 ++++---
5 files changed, 29 insertions(+), 3 deletions(-)
New commits:
commit 85ce7c0ac69577cf424f4230bcb9103cfdd73d43
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Jan 7 09:45:03 2015 +0100
Factor out XFillBitmapItem::dumpAsXml() from sw
Change-Id: Ice3a44635a1f4ac2c2852c2e73adae4920412d3a
diff --git a/include/svx/xbtmpit.hxx b/include/svx/xbtmpit.hxx
index e6a83b8..59996b2 100644
--- a/include/svx/xbtmpit.hxx
+++ b/include/svx/xbtmpit.hxx
@@ -68,6 +68,8 @@ public:
static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
XFillBitmapItem* checkForUniqueItem( SdrModel* pModel ) const;
+
+ virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE;
};
#endif
diff --git a/include/svx/xit.hxx b/include/svx/xit.hxx
index 3a90619..6ac1236 100644
--- a/include/svx/xit.hxx
+++ b/include/svx/xit.hxx
@@ -69,6 +69,8 @@ public:
If returned string equals NameOrIndex->GetName(), the name was already unique.
*/
static OUString CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, const SfxItemPool* pPool2, SvxCompareValueFunc pCompareValueFunc, sal_uInt16 nPrefixResId, const XPropertyListRef &pDefaults );
+
+ virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
#endif
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 8c3fc6b..8cb9dc2 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -260,6 +260,15 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u
return aUniqueName;
}
+void NameOrIndex::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("nameOrIndex"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("isIndex"), BAD_CAST(OString::boolean(IsIndex()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"), BAD_CAST(OString::number(GetIndex()).getStr()));
+ xmlTextWriterEndElement(pWriter);
+}
+
TYPEINIT1_AUTOFACTORY(XColorItem, NameOrIndex);
XColorItem::XColorItem(sal_uInt16 _nWhich, sal_Int32 nIndex, const Color& rTheColor) :
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index 23baafe..245884f 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -40,6 +40,8 @@
#include <vcl/bmpacc.hxx>
#include <vcl/dibtools.hxx>
+#include <libxml/xmlwriter.h>
+
using namespace ::com::sun::star;
XOBitmap::XOBitmap( const Bitmap& rBmp ) :
@@ -550,4 +552,14 @@ XFillBitmapItem* XFillBitmapItem::checkForUniqueItem( SdrModel* pModel ) const
return NULL;
}
+void XFillBitmapItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("xFillBitmapItem"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+
+ NameOrIndex::dumpAsXml(pWriter);
+
+ xmlTextWriterEndElement(pWriter);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 5a1adcb..8bc14bc 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -54,6 +54,7 @@
#include <svx/svdmodel.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xflclit.hxx>
+#include <svx/xbtmpit.hxx>
#include <tools/datetimeutils.hxx>
#include <libxml/encoding.h>
@@ -459,6 +460,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case XATTR_FILLCOLOR:
static_cast<const XFillColorItem*>(pItem)->dumpAsXml(writer);
break;
+ case XATTR_FILLBITMAP:
+ static_cast<const XFillBitmapItem*>(pItem)->dumpAsXml(writer);
+ break;
default: bDone = false; break;
}
if (bDone)
@@ -473,9 +477,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue;
switch (pItem->Which())
{
- case XATTR_FILLBITMAP:
- pWhich = "fill bitmap";
- break;
case XATTR_FILLTRANSPARENCE:
pWhich = "fill transparence";
break;
More information about the Libreoffice-commits
mailing list