include/vcl/toolkit/treelistbox.hxx |    4 ++++
 vcl/jsdialog/jsdialogbuilder.cxx    |    1 +
 vcl/source/app/salvtables.cxx       |    1 +
 vcl/source/treelist/svtabbx.cxx     |    2 ++
 vcl/source/treelist/treelistbox.cxx |    1 +
 5 files changed, 9 insertions(+)

New commits:
commit f97b7742d7d98439f88cf97796a0a336cf625782
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Tue Dec 9 22:10:23 2025 +0530
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Jan 5 10:01:49 2026 +0100

    jsdialog: allow treelist lazy loading
    
    mark entries visible and update jsdialogs when
    treelists are scrolled and new entries are visible
    
    Change-Id: I0c54cd2ae5473b6148f7d20c0b083066e28450e0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195318
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 777fff6a8088061e3d87bff84e2cd3015ebd2112)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196306
    Tested-by: Jenkins

diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index 42bfaef4dd81..f7cd71eb6471 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -217,6 +217,7 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvTreeListBox
     bool mbContextBmpExpanded;
     bool mbQuickSearch; // Enables type-ahead search in the check list box.
     bool mbActivateOnSingleClick; // Make single click "activate" a row like a 
double-click normally does
+    bool mbCustomEntryRenderer; // Used to define if the list entries are 
updated on demand
     bool mbHoverSelection; // Make mouse over a row "select" a row like a 
single-click normally does
     bool mbSelectingByHover; // true during "Select" if it was due to hover
     bool mbIsTextColumEnabled; // true if the property name text-column is 
enabled
@@ -664,6 +665,9 @@ public:
     void            SetActivateOnSingleClick(bool bEnable) { 
mbActivateOnSingleClick = bEnable; }
     bool            GetActivateOnSingleClick() const { return 
mbActivateOnSingleClick; }
 
+    void            SetCustomEntryRenderer(bool bEnable) { 
mbCustomEntryRenderer = bEnable; }
+    bool            GetCustomEntryRenderer() const { return 
mbCustomEntryRenderer; }
+
     // Make mouse over a row "select" a row like a single-click normally does
     void            SetHoverSelection(bool bEnable) { mbHoverSelection = 
bEnable; }
     bool            GetHoverSelection() const { return mbHoverSelection; }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index c0c7daa1d9c0..772ab1b28e69 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1820,6 +1820,7 @@ void JSTreeView::render_entry(int pos, int dpix, int dpiy)
 
     Size aRenderSize = signal_custom_get_size(*pDevice, get_id(pos));
     pDevice->SetOutputSize(aRenderSize);
+    m_xTreeView->MakeVisible(pEntry);
     m_xTreeView->DrawCustomEntry(*pDevice, tools::Rectangle(Point(0, 0), 
aRenderSize), *pEntry);
 
     Bitmap aImage = pDevice->GetBitmap(Point(0, 0), aRenderSize);
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 21b533c9ec17..9c4727fc0251 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4684,6 +4684,7 @@ void SalInstanceTreeView::visible_foreach(const 
std::function<bool(weld::TreeIte
 
 void SalInstanceTreeView::connect_visible_range_changed(const 
Link<weld::TreeView&, void>& rLink)
 {
+    m_xTreeView->SetCustomEntryRenderer(true);
     weld::TreeView::connect_visible_range_changed(rLink);
     m_xTreeView->SetScrolledHdl(LINK(this, SalInstanceTreeView, 
VisibleRangeChangedHdl));
 }
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index b453a0e1eafe..602326d5a102 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -214,6 +214,8 @@ void SvTabListBox::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
     }
 
     rJsonWriter.put("checkboxtype", checkboxtype);
+    if (GetCustomEntryRenderer())
+        rJsonWriter.put("customEntryRenderer", true);
     auto entriesNode = rJsonWriter.startArray("entries");
     lcl_DumpEntryAndSiblings(rJsonWriter, First(), this, bCheckButtons);
 }
diff --git a/vcl/source/treelist/treelistbox.cxx 
b/vcl/source/treelist/treelistbox.cxx
index 1590105397b5..b3a6aeeff361 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -407,6 +407,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits 
nWinStyle) :
     mbContextBmpExpanded(false),
     mbQuickSearch(false),
     mbActivateOnSingleClick(false),
+    mbCustomEntryRenderer(false),
     mbHoverSelection(false),
     mbSelectingByHover(false),
     mbIsTextColumEnabled(false),

Reply via email to