diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-22 12:57:00 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-27 22:39:40 +0100 |
commit | 70379753d3c070d95f654bc07aeab92f82e9f4e3 (patch) | |
tree | 9eef9e293a48e89d11f0ef339d7738beec6c106c /svx | |
parent | 880ff26edff0f7dfdd0d5b74fd9d7026fd2d8523 (diff) |
jsdialogs: dumpAsJSON for FillStyle
Change-Id: I0dc130c295b416b5b9e3071a0ec81dae0ce851fb
Reviewed-on: https://gerrit.libreoffice.org/83746
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
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; } |