From c7b97f2e4b8f47107bc91ded0295dcfffd0c71b6 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Wed, 23 Oct 2019 13:29:37 +0200 Subject: jsdilogs: send data for font name & size toolitems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia5ea058ba44b3a511a0bdbfc132a7de2d68f2e6b Reviewed-on: https://gerrit.libreoffice.org/81380 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- vcl/source/window/toolbox2.cxx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 4aecf7abfaa6..6700c3466ff2 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1771,21 +1771,25 @@ 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) + boost::property_tree::ptree::const_assoc_iterator found = aTree.find("children"); + if (found == aTree.not_found()) { - ToolBoxItemType type = GetItemType(i); - if (type == ToolBoxItemType::BUTTON) + for (unsigned long i = 0; i < GetItemCount(); ++i) { - 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)); + 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); + aTree.add_child("children", aChildren); + } return aTree; } -- cgit