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-28 09:27:56 +0100 |
commit | 5bc3ef9b93cfa2372ec5553affb14741db50bb2d (patch) | |
tree | eca28694e0c245f8506940a42dc8b79666c39862 /svx | |
parent | ae9e1569e736ad63bf2a2e197441657283c3f344 (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>
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 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; } |