include/svx/xfillit0.hxx | 1 + svx/source/xoutdev/xattr.cxx | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+)
New commits: commit 70379753d3c070d95f654bc07aeab92f82e9f4e3 Author: Szymon Kłos <[email protected]> AuthorDate: Fri Nov 22 12:57:00 2019 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Wed Nov 27 22:39:40 2019 +0100 jsdialogs: dumpAsJSON for FillStyle Change-Id: I0dc130c295b416b5b9e3071a0ec81dae0ce851fb Reviewed-on: https://gerrit.libreoffice.org/83746 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/include/svx/xfillit0.hxx b/include/svx/xfillit0.hxx index 3c7d3f69a439..b217232c70d8 100644 --- a/include/svx/xfillit0.hxx +++ b/include/svx/xfillit0.hxx @@ -50,6 +50,7 @@ public: virtual sal_uInt16 GetValueCount() const override; void dumpAsXml(struct _xmlTextWriter* 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 37708b2cdf5c..a3e7bbafdcb1 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -1835,6 +1835,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; } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
