[Libreoffice-commits] core.git: vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 10 11:25:43 UTC 2021


 vcl/source/window/toolbox2.cxx |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit bc8146713bfda2a1c3d0a5f313de79d3f997a6bf
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Sat Jan 9 18:44:28 2021 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Sun Jan 10 12:24:57 2021 +0100

    jsdialog: export correct children for toolbox
    
    if toolbox has children it means we have embedded widgets
    so don't export notmal 'toolitem' entries
    
    Change-Id: Ia1bd3323cf3606b923a4b30e1147633dcac24a87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109036
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 18cd1481d014..4336a0975901 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1731,19 +1731,22 @@ void ToolBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 {
     DockingWindow::DumpAsPropertyTree(rJsonWriter);
 
-    auto childrenNode = rJsonWriter.startArray("children");
-    for (ToolBox::ImplToolItems::size_type i = 0; i < GetItemCount(); ++i)
+    if (!GetChildCount())
     {
-        ToolBoxItemType type = GetItemType(i);
-        if (type == ToolBoxItemType::BUTTON)
+        auto childrenNode = rJsonWriter.startArray("children");
+        for (ToolBox::ImplToolItems::size_type i = 0; i < GetItemCount(); ++i)
         {
-            auto childNode = rJsonWriter.startStruct();
-            int nId = GetItemId(i);
-            if (!IsItemVisible(nId))
-                continue;
-            rJsonWriter.put("type", "toolitem");
-            rJsonWriter.put("text", GetItemText(nId));
-            rJsonWriter.put("command", GetItemCommand(nId));
+            ToolBoxItemType type = GetItemType(i);
+            if (type == ToolBoxItemType::BUTTON)
+            {
+                auto childNode = rJsonWriter.startStruct();
+                int nId = GetItemId(i);
+                if (!IsItemVisible(nId))
+                    continue;
+                rJsonWriter.put("type", "toolitem");
+                rJsonWriter.put("text", GetItemText(nId));
+                rJsonWriter.put("command", GetItemCommand(nId));
+            }
         }
     }
 }


More information about the Libreoffice-commits mailing list