diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-10-23 13:29:37 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-10-23 16:26:24 +0200 |
commit | c7b97f2e4b8f47107bc91ded0295dcfffd0c71b6 (patch) | |
tree | 1a5b5c5668aa95c22f0159a7c71f2ade1b1e690a /svx | |
parent | 36a1942bccdf63f26ea3a4497688f367083d2f0e (diff) |
jsdilogs: send data for font name & size toolitems
Change-Id: Ia5ea058ba44b3a511a0bdbfc132a7de2d68f2e6b
Reviewed-on: https://gerrit.libreoffice.org/81380
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 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunocontroller.cxx | 32 |
2 files changed, 64 insertions, 0 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index b1230050bc06..5f8ec0491977 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -242,6 +242,7 @@ public: virtual bool EventNotify( NotifyEvent& rNEvt ) override; virtual Reference< css::accessibility::XAccessible > CreateAccessible() override; void SetOwnFontList(::std::unique_ptr<FontList> && _aOwnFontList) { m_aOwnFontList = std::move(_aOwnFontList); } + virtual boost::property_tree::ptree DumpAsPropertyTree() override; }; // SelectHdl needs the Modifiers, get them in MouseButtonUp @@ -1311,6 +1312,7 @@ SvxFontNameBox_Impl::SvxFontNameBox_Impl( vcl::Window* pParent, const Reference< SetOptimalSize(); EnableControls_Impl(); GetSubEdit()->AddEventListener( LINK( this, SvxFontNameBox_Impl, CheckAndMarkUnknownFont )); + set_id("fontnamecombobox"); } SvxFontNameBox_Impl::~SvxFontNameBox_Impl() @@ -1585,6 +1587,36 @@ void SvxFontNameBox_Impl::Select() } } +boost::property_tree::ptree SvxFontNameBox_Impl::DumpAsPropertyTree() +{ + boost::property_tree::ptree aTree(FontNameBox::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; +} + SvxColorWindow::SvxColorWindow(const OUString& rCommand, std::shared_ptr<PaletteManager> const & rPaletteManager, ColorStatus& rColorStatus, diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index b806251dd805..19b2147c8fad 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -96,6 +96,7 @@ public: void SetOptimalSize(); virtual bool EventNotify( NotifyEvent& rNEvt ) override; + virtual boost::property_tree::ptree DumpAsPropertyTree() override; protected: virtual void Select() override; @@ -125,6 +126,7 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl( { SetValue( 0 ); SetText( "" ); + set_id("fontsizecombobox"); } void SvxFontSizeBox_Impl::ReleaseFocus_Impl() @@ -266,6 +268,36 @@ void SvxFontSizeBox_Impl::DataChanged( const DataChangedEvent& rDCEvt ) FontSizeBox::DataChanged( rDCEvt ); } +boost::property_tree::ptree SvxFontSizeBox_Impl::DumpAsPropertyTree() +{ + boost::property_tree::ptree aTree(FontSizeBox::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; +} + FontHeightToolBoxControl::FontHeightToolBoxControl( const uno::Reference< uno::XComponentContext >& rxContext ) : svt::ToolboxController( rxContext, uno::Reference< frame::XFrame >(), |