include/vcl/toolkit/svtabbx.hxx     |    5 +++--
 include/vcl/toolkit/treelist.hxx    |    2 +-
 include/vcl/toolkit/treelistbox.hxx |    5 +++--
 vcl/source/treelist/svtabbx.cxx     |   11 ++++-------
 vcl/source/treelist/treelist.cxx    |   10 ++++------
 vcl/source/treelist/treelistbox.cxx |   10 ++++------
 6 files changed, 19 insertions(+), 24 deletions(-)

New commits:
commit 8d1586bd7e6e9ac868849620317225a527a68591
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Jan 31 18:50:25 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Feb 1 09:13:05 2026 +0100

    vcl: Drop unused SvTreeListBox::Insert return value
    
    Change-Id: I859b0a04c81253608d369af0b45e3185a89d43fb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198472
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/toolkit/svtabbx.hxx b/include/vcl/toolkit/svtabbx.hxx
index 9f8b60107e45..0beddea9cf51 100644
--- a/include/vcl/toolkit/svtabbx.hxx
+++ b/include/vcl/toolkit/svtabbx.hxx
@@ -114,8 +114,9 @@ public:
 
     virtual SvTreeListEntry* InsertEntryToColumn( const OUString&, 
SvTreeListEntry* pParent,
                                  sal_uInt32 nPos, sal_uInt16 nCol, OUString* 
pUserData = nullptr ) override;
-    virtual sal_uInt32 Insert( SvTreeListEntry* pEnt,SvTreeListEntry* 
pPar,sal_uInt32 nPos=TREELIST_APPEND) override;
-    virtual sal_uInt32 Insert( SvTreeListEntry* pEntry, sal_uInt32 nRootPos = 
TREELIST_APPEND ) override;
+    virtual void Insert(SvTreeListEntry* pEnt, SvTreeListEntry* pPar,
+                        sal_uInt32 nPos = TREELIST_APPEND) override;
+    virtual void Insert(SvTreeListEntry* pEntry, sal_uInt32 nRootPos = 
TREELIST_APPEND) override;
 
     // Accessible -------------------------------------------------------------
 
diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index d5123bc37bc0..3e929b27c0b5 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -300,8 +300,9 @@ protected:
     // Invalidate children on enable/disable
     virtual void StateChanged( StateChangedType eType ) override;
 
-    virtual sal_uInt32 Insert( SvTreeListEntry* pEnt,SvTreeListEntry* 
pPar,sal_uInt32 nPos=TREELIST_APPEND);
-    virtual sal_uInt32 Insert( SvTreeListEntry* pEntry,sal_uInt32 nRootPos = 
TREELIST_APPEND );
+    virtual void Insert(SvTreeListEntry* pEnt, SvTreeListEntry* pPar,
+                        sal_uInt32 nPos = TREELIST_APPEND);
+    virtual void Insert(SvTreeListEntry* pEntry, sal_uInt32 nRootPos = 
TREELIST_APPEND);
 
     // In-place editing
     std::unique_ptr<SvInplaceEdit2>  pEdCtrl;
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 602326d5a102..805cd7d02808 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -579,19 +579,16 @@ SvTreeListEntry* SvHeaderTabListBox::InsertEntryToColumn(
     return pEntry;
 }
 
-sal_uInt32 SvHeaderTabListBox::Insert(
-    SvTreeListEntry* pEnt, SvTreeListEntry* pPar, sal_uInt32 nPos )
+void SvHeaderTabListBox::Insert(SvTreeListEntry* pEnt, SvTreeListEntry* pPar, 
sal_uInt32 nPos)
 {
-    sal_uInt32 n = SvTabListBox::Insert( pEnt, pPar, nPos );
+    SvTabListBox::Insert(pEnt, pPar, nPos);
     RecalculateAccessibleChildren();
-    return n;
 }
 
-sal_uInt32 SvHeaderTabListBox::Insert( SvTreeListEntry* pEntry, sal_uInt32 
nRootPos )
+void SvHeaderTabListBox::Insert(SvTreeListEntry* pEntry, sal_uInt32 nRootPos)
 {
-    sal_uInt32 nPos = SvTabListBox::Insert( pEntry, nRootPos );
+    SvTabListBox::Insert(pEntry, nRootPos);
     RecalculateAccessibleChildren();
-    return nPos;
 }
 
 void SvHeaderTabListBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
diff --git a/vcl/source/treelist/treelistbox.cxx 
b/vcl/source/treelist/treelistbox.cxx
index 4d9d3b9e0651..cb84119c359a 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -444,16 +444,14 @@ IMPL_LINK( SvTreeListBox, CloneHdl_Impl, 
SvTreeListEntry*, pEntry, SvTreeListEnt
     return CloneEntry(pEntry);
 }
 
-sal_uInt32 SvTreeListBox::Insert( SvTreeListEntry* pEntry, SvTreeListEntry* 
pParent, sal_uInt32 nPos )
+void SvTreeListBox::Insert(SvTreeListEntry* pEntry, SvTreeListEntry* pParent, 
sal_uInt32 nPos)
 {
-    sal_uInt32 nInsPos = pModel->Insert( pEntry, pParent, nPos );
-    return nInsPos;
+    pModel->Insert(pEntry, pParent, nPos);
 }
 
-sal_uInt32 SvTreeListBox::Insert( SvTreeListEntry* pEntry,sal_uInt32 nRootPos )
+void SvTreeListBox::Insert(SvTreeListEntry* pEntry, sal_uInt32 nRootPos)
 {
-    sal_uInt32 nInsPos = pModel->Insert( pEntry, nRootPos );
-    return nInsPos;
+    pModel->Insert(pEntry, nRootPos);
 }
 
 bool SvTreeListBox::ExpandingHdl()
commit 104270283c29da7a08d9050327b2c7fe8a981c1b
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sat Jan 31 18:38:14 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sun Feb 1 09:12:54 2026 +0100

    vcl: Switch SvTreeList::GetInsertionPos param to ref
    
    Pass the SvTreeListEntry param by reference instead of by pointer.
    Both callers already check/assert that the entry is non-null.
    
    Passing by reference also allows dropping a DBG_ASSERT.
    
    Change-Id: I7fdabb2bb04404fbbeab834b2f7cae203553dd07
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198471
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/toolkit/treelist.hxx b/include/vcl/toolkit/treelist.hxx
index e7b2f96255d4..3f84ef62a365 100644
--- a/include/vcl/toolkit/treelist.hxx
+++ b/include/vcl/toolkit/treelist.hxx
@@ -108,7 +108,7 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvTreeList final
 
     // rPos is not changed for SortModeNone
     SAL_DLLPRIVATE void GetInsertionPos(
-                            SvTreeListEntry const * pEntry,
+                            const SvTreeListEntry& rEntry,
                             SvTreeListEntry* pParent,
                             sal_uInt32& rPos
                         );
diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx
index 6f1f21bc9452..c0777ce01e99 100644
--- a/vcl/source/treelist/treelist.cxx
+++ b/vcl/source/treelist/treelist.cxx
@@ -331,7 +331,7 @@ void SvTreeList::InsertTree(SvTreeListEntry* pSrcEntry,
         pTargetParent = pRootItem.get();
 
     // take sorting into account
-    GetInsertionPos( pSrcEntry, pTargetParent, nListPos );
+    GetInsertionPos(*pSrcEntry, pTargetParent, nListPos);
 
     bAbsPositionsValid = false;
 
@@ -769,7 +769,7 @@ sal_uInt32 SvTreeList::Insert( SvTreeListEntry* 
pEntry,SvTreeListEntry* pParent,
     SvTreeListEntries& rList = pParent->m_Children;
 
     // take sorting into account
-    GetInsertionPos( pEntry, pParent, nPos );
+    GetInsertionPos(*pEntry, pParent, nPos);
 
     bAbsPositionsValid = false;
     pEntry->pParent = pParent;
@@ -1389,11 +1389,9 @@ void SvTreeList::ResortChildren( SvTreeListEntry* 
pParent )
     SetListPositions(pParent->m_Children); // correct list position in target 
list
 }
 
-void SvTreeList::GetInsertionPos( SvTreeListEntry const * pEntry, 
SvTreeListEntry* pParent,
+void SvTreeList::GetInsertionPos(const SvTreeListEntry& rEntry, 
SvTreeListEntry* pParent,
     sal_uInt32& rPos )
 {
-    DBG_ASSERT(pEntry,"No Entry");
-
     if( eSortMode == SvSortMode::None )
         return;
 
@@ -1412,7 +1410,7 @@ void SvTreeList::GetInsertionPos( SvTreeListEntry const * 
pEntry, SvTreeListEntr
     {
         k = (i+j)/2;
         const SvTreeListEntry* pTempEntry = rChildList[k].get();
-        nCompare = Compare( pEntry, pTempEntry );
+        nCompare = Compare(&rEntry, pTempEntry);
         if (nCompare != 0 && eSortMode == SvSortMode::Descending)
         {
             if( nCompare < 0 )

Reply via email to