summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-11-22 12:57:00 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2019-11-28 09:27:56 +0100
commit5bc3ef9b93cfa2372ec5553affb14741db50bb2d (patch)
treeeca28694e0c245f8506940a42dc8b79666c39862
parentae9e1569e736ad63bf2a2e197441657283c3f344 (diff)
jsdialogs: dumpAsJSON for FillStyle
Change-Id: I0dc130c295b416b5b9e3071a0ec81dae0ce851fb Reviewed-on: https://gerrit.libreoffice.org/83876 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--include/svx/xfillit0.hxx1
-rw-r--r--svx/source/xoutdev/xattr.cxx34
2 files changed, 35 insertions, 0 deletions
diff --git a/include/svx/xfillit0.hxx b/include/svx/xfillit0.hxx
index a1772092f991..e0855dfb7c56 100644
--- a/include/svx/xfillit0.hxx
+++ b/include/svx/xfillit0.hxx
@@ -48,6 +48,7 @@ public:
virtual sal_uInt16 GetValueCount() const override;
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
+ virtual boost::property_tree::ptree dumpAsJSON() const override;
};
#endif
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index e443ce84cd26..48eb70474e28 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -1834,6 +1834,40 @@ void XFillStyleItem::dumpAsXml(xmlTextWriterPtr pWriter) const
xmlTextWriterEndElement(pWriter);
}
+boost::property_tree::ptree XFillStyleItem::dumpAsJSON() const
+{
+ boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
+
+ if (Which() == XATTR_FILLSTYLE)
+ aTree.put("which", ".uno:FillStyle");
+
+ OUString sValue;
+
+ switch( GetValue() )
+ {
+ case drawing::FillStyle_NONE:
+ sValue = "NONE";
+ break;
+ case drawing::FillStyle_SOLID:
+ sValue = "SOLID";
+ break;
+ case drawing::FillStyle_GRADIENT:
+ sValue = "GRADIENT";
+ break;
+ case drawing::FillStyle_HATCH:
+ sValue = "HATCH";
+ break;
+ case drawing::FillStyle_BITMAP:
+ sValue = "BITMAP";
+ break;
+ default: break;
+ }
+
+ aTree.put("data", sValue);
+
+ return aTree;
+}
+
SfxPoolItem* XFillColorItem::CreateDefault() { return new XFillColorItem; }