summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2019-10-17 19:03:42 -0400
committerHenry Castro <hcastro@collabora.com>2019-10-18 16:47:10 +0200
commit4b4f3948905debae125cd7368ad6a252a0b90751 (patch)
tree978ec0ad3f1d3449de0677fcb99f20f8ff60533d /svtools/source
parent712c1ea7d31e3e89c87f7e019f5c224c924dfcbd (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/81001 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/control/valueset.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 0ccb65e01917..73a91e130b11 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1437,6 +1437,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 );