include/vcl/toolbox.hxx | 2 ++ vcl/source/control/listbox.cxx | 12 ++++++++++++ vcl/source/window/toolbox2.cxx | 24 ++++++++++++++++++++++++ 3 files changed, 38 insertions(+)
New commits: commit 5f174ea06d54c4a432f9b84c2bea9e3d572ec121 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: Mon Sep 30 09:46:28 2019 +0200 jsdialogs: send toolitems Change-Id: I113cd99dbcd8b7a2551271041ae749eaa68af8fc Reviewed-on: https://gerrit.libreoffice.org/79698 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 58bf32bb0e26..21c858667a90 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -520,6 +520,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 082cab508b82..5e5de5430d22 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1789,4 +1789,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: */ commit 2d7db23daebba00679b615a08ef933a0a78b96c9 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Sep 25 10:27:38 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Sep 30 09:46:22 2019 +0200 jsdialogs: send selection for listbox Change-Id: Ie5e026da0a4ca95df8fe52a6bf7967dc93b3d869 Reviewed-on: https://gerrit.libreoffice.org/79697 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index 88f0a64c44d4..1cc98f12a97c 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -1459,6 +1459,18 @@ boost::property_tree::ptree ListBox::DumpAsPropertyTree() 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; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits