diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-28 10:50:32 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-28 13:10:27 +0100 |
commit | 84692f8d10ecb35e31f19613507626d7818f7a44 (patch) | |
tree | 1e8a9e870c5f716a649540844ec473d3fbc07914 | |
parent | 00b473531b65aa5c10ea84aaedd05a35e6e50b25 (diff) |
jsdialog: dump Sfx_Int__Items to JSON
Change-Id: I6a1d2847251b90f86457b552e5354f5e179e1627
Reviewed-on: https://gerrit.libreoffice.org/83975
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | include/svl/intitem.hxx | 4 | ||||
-rw-r--r-- | svl/source/items/intitem.cxx | 20 |
2 files changed, 24 insertions, 0 deletions
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) |