vcl/inc/salvtables.hxx        |    2 ++
 vcl/source/app/salvtables.cxx |    9 +++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit c2014929cf27e4b00e0ed18b9284a593bf8cf684
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Apr 19 16:55:34 2023 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Thu Apr 20 15:26:09 2023 +0200

    Resolves: tdf#154912 make double-click to expand rows the same as arrow 
expand
    
    the arrow case does the necessary removal of the "dummy" entry which is
    necessary to get the treeview to indicate it has children, while the
    double click case skipped that step, so rearrange so both behave the
    same.
    
    Change-Id: I6161d786cd58b0eea53152074dff2b035c621e7f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150622
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>
    (cherry picked from commit 310a23fd4dde657038efb1e3fbb9db9e0cdbca3b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150630
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index d5605bf942bf..99fee1c0d48b 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1396,6 +1396,8 @@ protected:
     DECL_LINK(CustomRenderHdl, svtree_render_args, void);
     DECL_LINK(CustomMeasureHdl, svtree_measure_args, Size);
 
+    bool ExpandRow(const SalInstanceTreeIter& rIter);
+
     // Each row has a cell for the expander image, (and an optional cell for a
     // checkbutton if enable_toggle_buttons has been called) which precede
     // index 0
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2d3b6546d85a..343f37743033 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4750,7 +4750,7 @@ void SalInstanceTreeView::expand_row(const 
weld::TreeIter& rIter)
 {
     assert(m_xTreeView->IsUpdateMode() && "don't expand when frozen");
     const SalInstanceTreeIter& rVclIter = static_cast<const 
SalInstanceTreeIter&>(rIter);
-    if (!m_xTreeView->IsExpanded(rVclIter.iter) && signal_expanding(rIter))
+    if (!m_xTreeView->IsExpanded(rVclIter.iter) && ExpandRow(rVclIter))
         m_xTreeView->Expand(rVclIter.iter);
 }
 
@@ -5278,7 +5278,12 @@ IMPL_LINK_NOARG(SalInstanceTreeView, ExpandingHdl, 
SvTreeListBox*, bool)
     }
 
     // expanding
+    return ExpandRow(aIter);
+}
 
+bool SalInstanceTreeView::ExpandRow(const SalInstanceTreeIter& rIter)
+{
+    SvTreeListEntry* pEntry = rIter.iter;
     // if there's a preexisting placeholder child, required to make this
     // potentially expandable in the first place, now we remove it
     SvTreeListEntry* pPlaceHolder = GetPlaceHolderChild(pEntry);
@@ -5288,7 +5293,7 @@ IMPL_LINK_NOARG(SalInstanceTreeView, ExpandingHdl, 
SvTreeListBox*, bool)
         m_xTreeView->RemoveEntry(pPlaceHolder);
     }
 
-    bool bRet = signal_expanding(aIter);
+    bool bRet = signal_expanding(rIter);
 
     if (pPlaceHolder)
     {

Reply via email to