diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-10-23 17:10:35 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-10-23 21:41:05 +0200 |
commit | 00d06dee4b77cf52c927bd2c8687bb1a8d6c7904 (patch) | |
tree | 80accbe572dcbdc56baea5239c245b55a9e2d112 /svx | |
parent | bbb5479579dfdfb3e5f2c1c2ccda61cde58d2f39 (diff) |
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.klos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
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 ) { |