diff options
-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) |