summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2020-12-10 13:42:25 -0400
committerHenry Castro <hcastro@collabora.com>2020-12-18 18:22:40 +0100
commit00f587ecfe06274bf71356c913145a2e7847e763 (patch)
treeeef765dc8f5db2c01a2547b8860b9efbb32e5de2 /vcl
parent4ea3ec3d3aaa304b9769c2d5c7556529cc4df9ff (diff)
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@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/treelist/svtabbx.cxx13
1 files changed, 13 insertions, 0 deletions
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);