diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-01-10 18:03:49 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-01-10 22:07:06 +0100 |
commit | fc93925a935960c750f400b9b3c79a592baaf5fe (patch) | |
tree | 337cecc925a4f7b81af0c6cb314b3426b9f25ab5 /sfx2/source | |
parent | df5e6229b9ea3f881b5d66b418f1e63b892c80d3 (diff) |
lok: jsdialog creation for sidebar panels cleanup.
Use UNO panel names as ids on new Panel nodes.
This avoids problems with over-writing child details, items
like sd::PanelLayout don't have an empty parent to overwrite,
but have an immediate valueset node.
Change-Id: I00bab7f0d6a4fb247e0509bce7548b2da164bd23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86573
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index 563f1e229a60..345460a03cbd 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -203,7 +203,7 @@ boost::property_tree::ptree Deck::DumpAsPropertyTree() aTree.put("text", GetText()); aTree.put("enabled", IsEnabled()); - boost::property_tree::ptree aChildren; + boost::property_tree::ptree aPanelNodes; for (auto &it : maPanels) { if (it->IsLurking()) @@ -217,13 +217,20 @@ boost::property_tree::ptree Deck::DumpAsPropertyTree() if (!pWindow) continue; - boost::property_tree::ptree aChild = pWindow->DumpAsPropertyTree(); - aChild.put("text", it->GetText()); - aChild.put("type", "panel"); - aChildren.push_back(std::make_pair("", aChild)); + boost::property_tree::ptree aPanel; + aPanel.put("id", it->GetId()); + aPanel.put("type", "panel"); + aPanel.put("text", it->GetText()); + aPanel.put("enabled", it->IsEnabled()); + + boost::property_tree::ptree aChildren; + aChildren.push_back(std::make_pair("", pWindow->DumpAsPropertyTree())); + aPanel.add_child("children", aChildren); + + aPanelNodes.push_back(std::make_pair("", aPanel)); } + aTree.add_child("children", aPanelNodes); - aTree.add_child("children", aChildren); return aTree; } |