summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-11-28 10:50:32 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2019-11-28 13:10:29 +0100
commitbf5499c600e78e6197f4852d6cbe91ba1e703dc1 (patch)
treec740ab0646727ad70d02d8f277534300856cfe2f
parentdc213f0f65eebff560555fbd4ed3ae168cd24499 (diff)
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@collabora.com>
-rw-r--r--include/svl/intitem.hxx3
-rw-r--r--svl/source/items/intitem.cxx20
2 files changed, 23 insertions, 0 deletions
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)