[Libreoffice-commits] core.git: 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      |    3 +++
 svl/source/items/intitem.cxx |   20 ++++++++++++++++++++
 2 files changed, 23 insertions(+)

New commits:
commit bf5499c600e78e6197f4852d6cbe91ba1e703dc1
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:29 2019 +0100

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

diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx
index 8ecf53fadb08..c43add2013d7 100644
--- a/include/svl/intitem.hxx
+++ b/include/svl/intitem.hxx
@@ -90,6 +90,7 @@ public:
     { return new SfxUInt16Item(*this); }
 
     void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+    virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 
@@ -105,6 +106,7 @@ public:
     { return new SfxInt32Item(*this); }
 
     void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+    virtual boost::property_tree::ptree dumpAsJSON() const override;
 };
 
 
@@ -120,6 +122,7 @@ public:
     { return new SfxUInt32Item(*this); }
 
     void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+    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 f4016097637f..6bf9b2ef8300 100644
--- a/svl/source/items/intitem.cxx
+++ b/svl/source/items/intitem.cxx
@@ -107,6 +107,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
 
@@ -124,6 +131,13 @@ void SfxInt32Item::dumpAsXml(xmlTextWriterPtr pWriter) const
     xmlTextWriterEndElement(pWriter);
 }
 
+boost::property_tree::ptree SfxInt32Item::dumpAsJSON() const
+{
+    boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
+    aTree.put("state", GetValue());
+    return aTree;
+}
+
 
 //  class SfxUInt32Item
 
@@ -141,6 +155,12 @@ void SfxUInt32Item::dumpAsXml(xmlTextWriterPtr pWriter) const
     xmlTextWriterEndElement(pWriter);
 }
 
+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