svx/source/tbxctrls/tbcontrl.cxx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
New commits: commit 00d06dee4b77cf52c927bd2c8687bb1a8d6c7904 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Oct 23 17:10:35 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Oct 23 21:41:05 2019 +0200 jsdliaogs: send data for text styles combobox Change-Id: I5827799f8adf8db697ac2e2a96eaba2a6fd2e2a4 Reviewed-on: https://gerrit.libreoffice.org/81401 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5f8ec0491977..01ffb0603d93 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -154,6 +154,7 @@ public: void SetVisibilityListener( const Link<SvxStyleBox_Impl&,void>& aVisListener ) { aVisibilityListener = aVisListener; } void SetDefaultStyle( const OUString& rDefault ) { sDefaultStyle = rDefault; } + virtual boost::property_tree::ptree DumpAsPropertyTree() override; protected: /// Calculate the optimal width of the dropdown. Very expensive operation, triggers lots of font measurement. @@ -696,6 +697,7 @@ SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent, EnableUserDraw( true ); AddEventListener(LINK(this, SvxStyleBox_Impl, CalcOptimalExtraUserWidth)); SetUserItemSize( Size( 0, ITEM_HEIGHT ) ); + set_id("applystyle"); } SvxStyleBox_Impl::~SvxStyleBox_Impl() @@ -1226,6 +1228,36 @@ Color SvxStyleBox_Impl::TestColorsVisible(const Color &FontCol, const Color &Bac return retCol; } +boost::property_tree::ptree SvxStyleBox_Impl::DumpAsPropertyTree() +{ + boost::property_tree::ptree aTree(ComboBox::DumpAsPropertyTree()); + + boost::property_tree::ptree aEntries; + + for (int i = 0; i < GetEntryCount(); ++i) + { + boost::property_tree::ptree aEntry; + aEntry.put("", GetEntry(i)); + aEntries.push_back(std::make_pair("", aEntry)); + } + + aTree.add_child("entries", aEntries); + + boost::property_tree::ptree aSelected; + + for (int i = 0; i < GetSelectedEntryCount(); ++i) + { + boost::property_tree::ptree aEntry; + aEntry.put("", GetSelectedEntryPos(i)); + aSelected.push_back(std::make_pair("", aEntry)); + } + + aTree.put("selectedCount", GetSelectedEntryCount()); + aTree.add_child("selectedEntries", aSelected); + + return aTree; +} + static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl* pBox ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits