summaryrefslogtreecommitdiff
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:36 +0200
commit49c968cccfa3f6b2dd0476313190ed3d1d81b3f5 (patch)
tree41c02bdce63af6ae160b89882a97ce1684ac235f
parentb13421c6560e4f189265c96a3145aa11568b4437 (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>
-rw-r--r--include/svtools/valueset.hxx1
-rw-r--r--include/vcl/image.hxx2
-rw-r--r--svtools/source/control/valueset.cxx22
3 files changed, 24 insertions, 1 deletions
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index ec8daf986478..3855795d0627 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -295,6 +295,7 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt ) override;
virtual void StateChanged( StateChangedType nStateChange ) override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
+ virtual boost::property_tree::ptree DumpAsPropertyTree() override;
virtual void Select();
virtual void UserDraw( const UserDrawEvent& rUDEvt );
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index 1267e1a439e5..07ea7a7764b3 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -71,7 +71,7 @@ public:
return !(Image::operator==(rImage));
}
- SAL_DLLPRIVATE OUString GetStock() const;
+ OUString GetStock() const;
void Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle, const Size* pSize = nullptr);
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 );