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 73ab0cdd2f5c358014f1200af8c7b689e42959a9
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Tue Dec 9 22:10:23 2025 +0530
Commit:     Pranam Lashkari <[email protected]>
CommitDate: Fri Dec 12 13:42:27 2025 +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/+/195509
    Tested-by: Pranam Lashkari <[email protected]>

diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index 47850505cc52..4235b31f4a55 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -216,6 +216,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
@@ -667,6 +668,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 c92003d9038c..c99653279f1c 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1888,6 +1888,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);
 
     BitmapEx aImage = pDevice->GetBitmapEx(Point(0, 0), aRenderSize);
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 3c4ca0ee9969..c243a8ea14d2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4909,6 +4909,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 edf47d9f47d9..506de9f3e5ce 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -216,6 +216,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 d40c90ac479a..f021b7024487 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -391,6 +391,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