[Libreoffice-commits] core.git: editeng/source include/editeng include/svl include/svx svl/source svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 26 01:27:04 UTC 2018


 editeng/source/items/textitem.cxx |   13 +++++++++++++
 include/editeng/colritem.hxx      |    2 ++
 include/svl/intitem.hxx           |    3 +++
 include/svx/e3ditem.hxx           |    2 ++
 svl/source/items/intitem.cxx      |   16 ++++++++++++++++
 svx/source/items/e3ditem.cxx      |   11 +++++++++++
 6 files changed, 47 insertions(+)

New commits:
commit 9e04fac561efd6bbfd6e43b0499b5542c0b4f526
Author:     Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Thu Nov 22 04:30:48 2018 +0100
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Mon Nov 26 02:26:41 2018 +0100

    add dumpAsXml methods to more pool items
    
    Change-Id: Ia33ac2dfa23bdc4e2990e6d028d1bae7fedfe4f5
    Reviewed-on: https://gerrit.libreoffice.org/63853
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index b3912754cbe4..483e83f657f7 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -28,6 +28,7 @@
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
 #include <unotools/fontdefs.hxx>
+#include <unotools/intlwrapper.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/unohelp.hxx>
 #include <editeng/eeitem.hxx>
@@ -1745,6 +1746,18 @@ bool SvxColorItem::GetPresentation
     return true;
 }
 
+void SvxColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("SvxColorItem"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+    OUString aStr;
+    IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
+    GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, aStr, aIntlWrapper);
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
+
+
 
 void SvxColorItem::SetValue( const Color& rNewCol )
 {
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index 49415c9a7b82..2fb55666e639 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -68,6 +68,8 @@ public:
         return mColor;
     }
     void SetValue(const Color& rNewColor);
+
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
 };
 
 // XXX: to be moved in a separate header.
diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx
index 448eda8a514b..165fabae8da9 100644
--- a/include/svl/intitem.hxx
+++ b/include/svl/intitem.hxx
@@ -121,6 +121,7 @@ public:
     virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
     { return new SfxInt32Item(*this); }
 
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
 };
 
 
@@ -140,6 +141,8 @@ public:
 
     virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
     { return new SfxUInt32Item(*this); }
+
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
 };
 
 #endif // INCLUDED_SVL_INTITEM_HXX
diff --git a/include/svx/e3ditem.hxx b/include/svx/e3ditem.hxx
index 57ccdb1f581e..e18e50a2795c 100644
--- a/include/svx/e3ditem.hxx
+++ b/include/svx/e3ditem.hxx
@@ -44,6 +44,8 @@ public:
     const basegfx::B3DVector&           GetValue() const { return aVal; }
 
     virtual sal_uInt16 GetVersion (sal_uInt16 nFileFormatVersion) const override;
+
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
 };
 
 #endif
diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx
index 37d07926e2bf..8e8ce37ea335 100644
--- a/svl/source/items/intitem.cxx
+++ b/svl/source/items/intitem.cxx
@@ -138,6 +138,14 @@ SfxPoolItem* SfxInt32Item::CreateDefault()
     return new SfxInt32Item();
 };
 
+void SfxInt32Item::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("SfxInt32Item"));
+    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 SfxUInt32Item
 
@@ -147,6 +155,14 @@ SfxPoolItem* SfxUInt32Item::CreateDefault()
     return new SfxUInt32Item();
 };
 
+void SfxUInt32Item::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("SfxUInt32Item"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
+
 
 SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_uInt32 nValue):
     SfxInt32Item(which, nValue)
diff --git a/svx/source/items/e3ditem.cxx b/svx/source/items/e3ditem.cxx
index 3d6012620191..86f749c6eaab 100644
--- a/svx/source/items/e3ditem.cxx
+++ b/svx/source/items/e3ditem.cxx
@@ -21,6 +21,7 @@
 #include <comphelper/fileformat.h>
 #include <tools/stream.hxx>
 #include <rtl/math.hxx>
+#include <libxml/xmlwriter.h>
 
 #include <svx/e3ditem.hxx>
 
@@ -98,4 +99,14 @@ sal_uInt16 SvxB3DVectorItem::GetVersion (sal_uInt16 nFileFormatVersion) const
     return (nFileFormatVersion == SOFFICE_FILEFORMAT_31) ? USHRT_MAX : 0;
 }
 
+void SvxB3DVectorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("SvxB3DVectorItem"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("x"), BAD_CAST(OString::number(aVal.getX()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("y"), BAD_CAST(OString::number(aVal.getY()).getStr()));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("z"), BAD_CAST(OString::number(aVal.getZ()).getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list