summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2020-01-10 18:03:49 +0000
committerMichael Meeks <michael.meeks@collabora.com>2020-01-10 22:06:59 +0100
commit6b7d962330a0580721a2304ac1ada133d166011f (patch)
treee8009d710da181fa37597e25be134e1716c67c89 /sfx2
parenta0c9bfc8186ca6fae43f611554f4a23e99250f54 (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/+/86571 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/Deck.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 6def9683727e..ba8f4928ac0b 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -193,7 +193,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())
@@ -207,13 +207,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;
}