include/vcl/toolbox.hxx | 2 ++ vcl/source/window/toolbox2.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+)
New commits: commit 6d46ccc6b52c45d3d64a1c66f616defd12147bc5 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Sep 25 11:58:27 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Oct 1 14:05:21 2019 +0200 jsdialogs: send toolitems Change-Id: I113cd99dbcd8b7a2551271041ae749eaa68af8fc Reviewed-on: https://gerrit.libreoffice.org/79806 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 32f9c061889e..0fa569248dd2 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -521,6 +521,8 @@ public: void SetToolBoxTextPosition( ToolBoxTextPosition ePosition ); void SetLineSpacing(bool b) { mbLineSpacing = b; } + + virtual boost::property_tree::ptree DumpAsPropertyTree() override; }; inline void ToolBox::CheckItem( sal_uInt16 nItemId, bool bCheck ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index ba92d20db57a..4aecf7abfaa6 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1766,4 +1766,28 @@ void ToolBox::WillUsePopupMode( bool b ) mpData->mbWillUsePopupMode = b; } +boost::property_tree::ptree ToolBox::DumpAsPropertyTree() +{ + boost::property_tree::ptree aTree(DockingWindow::DumpAsPropertyTree()); + boost::property_tree::ptree aChildren; + + for (unsigned long i = 0; i < GetItemCount(); ++i) + { + ToolBoxItemType type = GetItemType(i); + if (type == ToolBoxItemType::BUTTON) + { + boost::property_tree::ptree aEntry; + int nId = GetItemId(i); + aEntry.put("type", "toolitem"); + aEntry.put("text", GetItemText(nId)); + aEntry.put("command", GetItemCommand(nId)); + aChildren.push_back(std::make_pair("", aEntry)); + } + } + + aTree.add_child("children", aChildren); + + return aTree; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits