[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/svl svl/source

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 28 12:11:25 UTC 2019


 include/svl/intitem.hxx      |    4 ++++
 svl/source/items/intitem.cxx |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

New commits:
commit 84692f8d10ecb35e31f19613507626d7818f7a44
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 28 10:50:32 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Nov 28 13:10:27 2019 +0100

    jsdialog: dump Sfx_Int__Items to JSON
    
    Change-Id: I6a1d2847251b90f86457b552e5354f5e179e1627
    Reviewed-on: https://gerrit.libreoffice.org/83975
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx
index c72ae3ad52d4..737c302e2d59 100644
--- a/include/svl/intitem.hxx
+++ b/include/svl/intitem.hxx
@@ -104,6 +104,7 @@ public:
     { return new SfxUInt16Item(*this); }
 
     void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
+    virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 
@@ -124,6 +125,7 @@ public:
     virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
     { return new SfxInt32Item(*this); }
 
+    virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 
@@ -143,6 +145,8 @@ public:
 
     virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override
     { return new SfxUInt32Item(*this); }
+
+    virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 #endif // INCLUDED_SVL_INTITEM_HXX
diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx
index 7a80264d3039..afa9923265ea 100644
--- a/svl/source/items/intitem.cxx
+++ b/svl/source/items/intitem.cxx
@@ -137,6 +137,13 @@ void SfxUInt16Item::dumpAsXml(xmlTextWriterPtr pWriter) const
     xmlTextWriterEndElement(pWriter);
 }
 
+boost::property_tree::ptree SfxUInt16Item::dumpAsJSON() const
+{
+    boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
+    aTree.put("state", GetValue());
+    return aTree;
+}
+
 
 //  class SfxInt32Item
 
@@ -146,6 +153,13 @@ SfxPoolItem* SfxInt32Item::CreateDefault()
     return new SfxInt32Item();
 };
 
+boost::property_tree::ptree SfxInt32Item::dumpAsJSON() const
+{
+    boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
+    aTree.put("state", GetValue());
+    return aTree;
+}
+
 
 //  class SfxUInt32Item
 
@@ -155,6 +169,12 @@ SfxPoolItem* SfxUInt32Item::CreateDefault()
     return new SfxUInt32Item();
 };
 
+boost::property_tree::ptree SfxUInt32Item::dumpAsJSON() const
+{
+    boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
+    aTree.put("state", GetValue());
+    return aTree;
+}
 
 SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_uInt32 nValue):
     SfxInt32Item(which, nValue)


More information about the Libreoffice-commits mailing list