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

New commits:
commit 39f3bde1193257434bf7384cb15654bc4d5088bc
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Thu Dec 10 13:42:25 2020 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Mon Jan 18 22:30:01 2021 +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 <hcas...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109138
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index a5375af509bf..4cfb34668907 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -74,6 +74,19 @@ static boost::property_tree::ptree 
lcl_DumpEntryAndSiblings(SvTreeListEntry* pEn
 
         aEntry.push_back(std::make_pair("columns", aColumns));
 
+        // 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>")
+                    aEntry.put("ondemand", "true");
+            }
+        }
+
         if (bCheckButtons)
         {
             SvButtonState eCheckState = 
pTabListBox->GetCheckButtonState(pEntry);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to