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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 18 17:23:25 UTC 2020


 vcl/source/treelist/svtabbx.cxx |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit 00f587ecfe06274bf71356c913145a2e7847e763
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Dec 10 13:42:25 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Fri Dec 18 18:22:40 2020 +0100

    lok: add "ondemand" property to dump the TreeView property
    
    The "SalInstanceTreeView" instance does not use the flag
    "CHILDREN_ON_DEMAND", but instead it creates a "<dummy>" child.
    
    However the client side requires "on demand" information to
    request and trigger the "On Expanding" event.
    
    Change-Id: I4d8667fc83dae2c5f1d477fefa9c9917a5e6c90d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107576
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 816acb66a46c..613d1831bf2b 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -73,6 +73,19 @@ static void lcl_DumpEntryAndSiblings(tools::JsonWriter& rJsonWriter,
             }
         }
 
+        // SalInstanceTreeView does not use the flag CHILDREN_ON_DEMAND
+        // and it creates a dummy child
+        const SvTreeListEntries& rChildren = pEntry->GetChildEntries();
+        if (rChildren.size() == 1)
+        {
+            auto& rChild = rChildren[0];
+            if (const SvLBoxItem* pChild = rChild->GetFirstItem(SvLBoxItemType::String))
+            {
+                if (static_cast<const SvLBoxString*>(pChild)->GetText() == "<dummy>")
+                    rJsonWriter.put("ondemand", "true");
+            }
+        }
+
         if (bCheckButtons)
         {
             SvButtonState eCheckState = pTabListBox->GetCheckButtonState(pEntry);


More information about the Libreoffice-commits mailing list