vcl/source/app/salvtables.cxx | 5 +++-- vcl/source/treelist/treelist.cxx | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-)
New commits: commit 90c8284a35d51d382b03184c90b0e8769318cb06 Author: Michael Weghorn <[email protected]> AuthorDate: Mon Jan 12 12:21:57 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Jan 13 19:36:40 2026 +0100 vcl weld: Check weld::TreeView::iter_next return value In SalInstanceTreeView::all_foreach, evaluate the return value of weld::TreeView::iter_next to find out whether there was a next element instead of checking whether the in/out SalInstanceTreeIter param has a non-null SvTreeListEntry set. This prepares for upcoming commit Change-Id: Ie54463f7e5fbf0cd3665ab5db416b44e87e4a037 Author: Michael Weghorn <[email protected]> Date: Sat Jan 10 23:23:56 2026 +0100 tdf#130857 weld: Implement TreeView::iter_next in base class from which on the in/out param will no longer be modified if there is no next element. Change-Id: Ie8e035e9439d725b0e7c1ac83d4b48233dcf654c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197091 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index a6c9e738b309..114022150c83 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -4652,11 +4652,12 @@ void SalInstanceTreeView::all_foreach(const std::function<bool(weld::TreeIter&)> UpdateGuardIfHidden aGuard(*m_xTreeView); SalInstanceTreeIter aVclIter(m_xTreeView->First()); - while (aVclIter.iter) + bool bContinue = aVclIter.iter; + while (bContinue) { if (func(aVclIter)) return; - iter_next(aVclIter); + bContinue = iter_next(aVclIter); } } commit 9472b5fcc01d75823f3f878450bf5ee7cb6eef0b Author: Michael Weghorn <[email protected]> AuthorDate: Mon Jan 12 11:31:50 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Jan 13 19:36:33 2026 +0100 vcl: Drop redundant DBG_ASSERT The loop condition already ensures that pParent is non-null. Change-Id: I7793503913e9abc2ed945d903b3fd25dabfc46d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197085 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index 1e696d75abed..2d695f5205fc 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -508,7 +508,6 @@ SvTreeListEntry* SvTreeList::Next( SvTreeListEntry* pActEntry, sal_uInt16* pDept nDepth--; while( pParent != pRootItem.get() && pParent != nullptr ) { - DBG_ASSERT(pParent!=nullptr,"TreeData corrupt!"); pActualList = &pParent->pParent->m_Children; nActualPos = pParent->GetChildListPos(); if (pActualList->size() > (nActualPos+1)) commit 8c676ad1a9370f6958819b210e1bf853a274a3e3 Author: Michael Weghorn <[email protected]> AuthorDate: Mon Jan 12 11:30:49 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Tue Jan 13 19:36:25 2026 +0100 vcl: Move vars in SvTreeList::Next closer to use These two local variables are not used when the entry has children (i.e. when the if block below is entered). Move them further down to where they are actually needed. Change-Id: Id6435352f2c0ccacc1c895c619c14392c4ccb884 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197084 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index 1f158e5fd04a..1e696d75abed 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -481,10 +481,6 @@ SvTreeListEntry* SvTreeList::Next( SvTreeListEntry* pActEntry, sal_uInt16* pDept bWithDepth = true; } - // Get the list where the current entry belongs to (from its parent). - SvTreeListEntries* pActualList = &pActEntry->pParent->m_Children; - sal_uInt32 nActualPos = pActEntry->GetChildListPos(); - if (!pActEntry->m_Children.empty()) { // The current entry has children. Get its first child entry. @@ -495,6 +491,9 @@ SvTreeListEntry* SvTreeList::Next( SvTreeListEntry* pActEntry, sal_uInt16* pDept return pActEntry; } + // Get the list where the current entry belongs to (from its parent). + SvTreeListEntries* pActualList = &pActEntry->pParent->m_Children; + sal_uInt32 nActualPos = pActEntry->GetChildListPos(); if (pActualList->size() > (nActualPos+1)) { // Get the next sibling of the current entry.
