diff options
author | Henry Castro <hcastro@collabora.com> | 2019-10-17 19:03:42 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2019-10-18 16:47:36 +0200 |
commit | 49c968cccfa3f6b2dd0476313190ed3d1d81b3f5 (patch) | |
tree | 41c02bdce63af6ae160b89882a97ce1684ac235f /svtools | |
parent | b13421c6560e4f189265c96a3145aa11568b4437 (diff) |
lok: dump as property tree the valueset control
In order to create a container element at client side dialog
using DialogWizard. It is required to send the items of the
valueset control.
Change-Id: Ib0fdc444c7126e6888e37c8a01f8e7f04c641d18
Reviewed-on: https://gerrit.libreoffice.org/81042
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/valueset.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 94c3cac34afd..494583799287 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1433,6 +1433,28 @@ void ValueSet::DataChanged( const DataChangedEvent& rDataChangedEvent ) } } +boost::property_tree::ptree ValueSet::DumpAsPropertyTree() +{ + boost::property_tree::ptree aTree(Control::DumpAsPropertyTree()); + boost::property_tree::ptree aEntries; + + const size_t nSize = mItemList.size(); + + for ( size_t nIt = 0; nIt < nSize; ++nIt ) + { + boost::property_tree::ptree aEntry; + ValueSetItem* pItem = mItemList[nIt].get(); + aEntry.put("id", pItem->mnId); + aEntry.put("text", pItem->maText); + aEntry.put("image", pItem->maImage.GetStock()); + aEntries.push_back(std::make_pair("", aEntry)); + } + + aTree.put("type", "valueset"); + aTree.add_child("entries", aEntries); + return aTree; +} + void ValueSet::Select() { maSelectHdl.Call( this ); |