basctl/source/basicide/moduldlg.cxx | 2 - cui/source/dialogs/MacroManagerDialog.cxx | 2 - dbaccess/source/ui/browser/unodatbr.cxx | 11 ++++---- dbaccess/source/ui/control/dbtreelistbox.cxx | 5 +--- sc/source/ui/navipi/content.cxx | 14 +++++------ sd/source/ui/animations/CustomAnimationList.cxx | 2 - sd/source/ui/dlg/sdtreelb.cxx | 10 +++----- svx/source/form/filtnav.cxx | 4 +-- svx/source/form/fmexch.cxx | 8 ++---- svx/source/form/navigatortree.cxx | 30 ++++++++++++------------ svx/source/inc/fmexch.hxx | 2 - sw/source/uibase/utlui/content.cxx | 14 +++++------ 12 files changed, 49 insertions(+), 55 deletions(-)
New commits: commit a82e579a8e2b1c5e998a98c8eac7322a89afad36 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Jan 20 19:59:00 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jan 22 11:16:01 2026 +0100 sfx: Simplify weld::TreeIter equality check ... in OControlTransferData::onEntryRemoved and adjust callers accordingly. See also this previous commit for more background: Change-Id: I9386e100f83b9bdb832b50f1056305b81c23e351 Author: Michael Weghorn <[email protected]> Date: Tue Jan 20 19:52:12 2026 +0100 tdf#130857 Simplify various weld::TreeIter equality checks Change-Id: I4003faa909f2ec6186328fdf70556428ee1d81b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197688 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx index e45cc4573009..c9084b8c273d 100644 --- a/svx/source/form/fmexch.cxx +++ b/svx/source/form/fmexch.cxx @@ -163,12 +163,10 @@ namespace svxform } } - size_t OControlTransferData::onEntryRemoved(const weld::TreeView* pView, const weld::TreeIter* _pEntry) + size_t OControlTransferData::onEntryRemoved(const weld::TreeIter* _pEntry) { auto aIter = std::find_if(m_aSelectedEntries.begin(), m_aSelectedEntries.end(), - [pView, _pEntry](const auto& rElem) { - return pView->iter_compare(*rElem, *_pEntry) == 0; - }); + [_pEntry](const auto& rElem) { return rElem->equal(*_pEntry); }); if (aIter != m_aSelectedEntries.end()) m_aSelectedEntries.erase(aIter); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 6b1bc58e91e1..4583e1ffa190 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1193,7 +1193,7 @@ namespace svxform if (m_aControlExchange.isDataExchangeActive()) { - if (0 == m_aControlExchange->onEntryRemoved(m_xTreeView.get(), pTypedEntry)) + if (0 == m_aControlExchange->onEntryRemoved(pTypedEntry)) { // last of the entries which we put into the clipboard has been deleted from the tree. // Give up the clipboard ownership. diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx index 12eee61e70a1..516b2dc802d5 100644 --- a/svx/source/inc/fmexch.hxx +++ b/svx/source/inc/fmexch.hxx @@ -154,7 +154,7 @@ namespace svxform @param _pEntry @return the number of entries remaining in the selection. */ - size_t onEntryRemoved(const weld::TreeView* pView, const weld::TreeIter* _pEntry); + size_t onEntryRemoved(const weld::TreeIter* _pEntry); void setFormsRoot( const css::uno::Reference< css::form::XForms >& _rxFormsRoot commit 3218a3c1c6e8639f9d8d1768e9dac398a00630a7 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Jan 20 19:52:12 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jan 22 11:15:54 2026 +0100 tdf#130857 Simplify various weld::TreeIter equality checks All of these places check whether ther result of weld::TreeView::iter_compare is 0, i.e. whether the iters are equal. Simplify this by using weld::TreeIter::equal instead. For the case where iters are not equal, this is also more efficient (because there is no need to find out which of the entries pointed to by the iterators comes earlier), at least with the default implementation introduced in previous commit Change-Id: Id098f85608f4f747c8f0bd4dd2eef01f0aba358d Author: Michael Weghorn <[email protected]> Date: Tue Jan 20 19:04:59 2026 +0100 tdf#130857: weld:: Add default TreeView::iter_compare impl Change-Id: I9386e100f83b9bdb832b50f1056305b81c23e351 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197687 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 9eb9cc6c9a2c..9df40f8d8556 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -329,7 +329,7 @@ private: else if (nDepth == 1) { std::unique_ptr<weld::TreeIter> xSelParent(pSource->make_iterator(xSelected.get())); - if (pSource->iter_parent(*xSelParent) && pSource->iter_compare(*xEntry, *xSelParent) == 0) + if (pSource->iter_parent(*xSelParent) && xEntry->equal(*xSelParent)) bValid = false; } else if (nDepth == 2) diff --git a/cui/source/dialogs/MacroManagerDialog.cxx b/cui/source/dialogs/MacroManagerDialog.cxx index 84810643f902..f70d55afb0eb 100644 --- a/cui/source/dialogs/MacroManagerDialog.cxx +++ b/cui/source/dialogs/MacroManagerDialog.cxx @@ -177,7 +177,7 @@ void ScriptContainersListBox::Remove(const weld::TreeIter* pEntryIter, bool bRem // children must be removed from the tree in reverse order std::unique_ptr<weld::TreeIter> xRemoveIter = m_xTreeView->make_iterator(); - while (m_xTreeView->iter_compare(*xIter, *pEntryIter) != 0) + while (!xIter->equal(*pEntryIter)) { m_xTreeView->copy_iterator(*xIter, *xRemoveIter); (void)m_xTreeView->iter_previous(*xIter); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 36b647b7f364..b9181f25c2aa 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2267,7 +2267,7 @@ bool SbaTableQueryBrowser::ensureEntryObject(const weld::TreeIter& rEntry) std::unique_ptr<weld::TreeIter> xParent(rTreeView.make_iterator(&rEntry)); if (rTreeView.iter_parent(*xParent)) { - if (rTreeView.iter_compare(*xParent, *xDataSourceEntry) != 0) + if (!xParent->equal(*xDataSourceEntry)) { OUString aName(rTreeView.get_text(rEntry)); DBTreeListUserData* pData = weld::fromId<DBTreeListUserData*>(rTreeView.get_id(*xParent)); @@ -2531,7 +2531,7 @@ bool SbaTableQueryBrowser::implSelect(const weld::TreeIter* pEntry) std::unique_ptr<weld::TreeIter> xNextTemp = rTreeView.make_iterator(xTemp.get()); if (rTreeView.iter_parent(*xNextTemp)) { - while (rTreeView.iter_compare(*xNextTemp, *xConnection) != 0) + while (!xNextTemp->equal(*xConnection)) { sNameBuffer.insert(0, rTreeView.get_text(*xTemp) + "/"); rTreeView.copy_iterator(*xNextTemp, *xTemp); @@ -2789,7 +2789,7 @@ bool SbaTableQueryBrowser::isCurrentlyDisplayedChanged(std::u16string_view rName if (rTreeView.get_text(*m_xCurrentlyDisplayed) != rName) return false; std::unique_ptr<weld::TreeIter> xParent = rTreeView.make_iterator(m_xCurrentlyDisplayed.get()); - return rTreeView.iter_parent(*xParent) && rTreeView.iter_compare(*xParent, rContainer) == 0; + return rTreeView.iter_parent(*xParent) && xParent->equal(rContainer); } void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEvent ) @@ -2976,7 +2976,7 @@ void SbaTableQueryBrowser::closeConnection(const weld::TreeIter& rDSEntry, bool if (m_xCurrentlyDisplayed) { std::unique_ptr<weld::TreeIter> xRoot = m_pTreeView->GetRootLevelParent(m_xCurrentlyDisplayed.get()); - if (rTreeView.iter_compare(*xRoot, rDSEntry) == 0) + if (xRoot->equal(rDSEntry)) unloadAndCleanup(_bDisposeConnection); } @@ -3329,8 +3329,7 @@ bool SbaTableQueryBrowser::impl_isDataSourceEntry(const weld::TreeIter* pEntry) if (!pEntry) return false; std::unique_ptr<weld::TreeIter> xRoot(m_pTreeView->GetRootLevelParent(pEntry)); - weld::TreeView& rTreeView = m_pTreeView->GetWidget(); - return rTreeView.iter_compare(*xRoot, *pEntry) == 0; + return xRoot->equal(*pEntry); } bool SbaTableQueryBrowser::ensureConnection(const weld::TreeIter* pDSEntry, void* pDSData, SharedConnection& rConnection) diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 54605ad590b3..6b24eaccf99c 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -254,7 +254,7 @@ sal_Int8 TreeListBox::AcceptDrop(const AcceptDropEvent& rEvt) if (!m_xTreeView->iter_parent(*xParent)) xParent.reset(); } - while (xParent && m_xTreeView->iter_compare(*xParent, *m_xDragedEntry) != 0) + while (xParent && !xParent->equal(*m_xDragedEntry)) { if (!m_xTreeView->iter_parent(*xParent)) xParent.reset(); @@ -267,8 +267,7 @@ sal_Int8 TreeListBox::AcceptDrop(const AcceptDropEvent& rEvt) // check if move is allowed if ( nDropOption & DND_ACTION_MOVE ) { - if (!m_xDragedEntry || !xDropTarget || - m_xTreeView->iter_compare(*m_xDragedEntry, *xDropTarget) == 0 || + if (!m_xDragedEntry || !xDropTarget || m_xDragedEntry->equal(*xDropTarget) || GetEntryPosByName(m_xTreeView->get_text(*m_xDragedEntry), xDropTarget.get())) { nDropOption = nDropOption & ~DND_ACTION_MOVE;//DND_ACTION_NONE; diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index aaeed24d6870..b8fb2c1cc30a 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -276,13 +276,13 @@ void ScContentTree::GetEntryIndexes(ScContentId& rnRootIndex, sal_uLong& rnChild ScContentId nRoot = static_cast<ScContentId>(i); if (!m_aRootNodes[nRoot]) continue; - if (m_xTreeView->iter_compare(*pEntry, *m_aRootNodes[nRoot]) == 0) + if (pEntry->equal(*m_aRootNodes[nRoot])) { rnRootIndex = nRoot; rnChildIndex = ~0UL; bFound = true; } - else if (xParent && m_xTreeView->iter_compare(*xParent, *m_aRootNodes[nRoot]) == 0) + else if (xParent && xParent->equal(*m_aRootNodes[nRoot])) { rnRootIndex = nRoot; @@ -292,7 +292,7 @@ void ScContentTree::GetEntryIndexes(ScContentId& rnRootIndex, sal_uLong& rnChild bool bIterEntry = m_xTreeView->iter_children(*xIterEntry); while (!bFound && bIterEntry) { - if (m_xTreeView->iter_compare(*pEntry, *xIterEntry) == 0) + if (pEntry->equal(*xIterEntry)) { rnChildIndex = nEntry; bFound = true; // exit the while loop @@ -674,11 +674,11 @@ IMPL_LINK(ScContentTree, QueryTooltipHdl, const weld::TreeIter&, rEntry, OUStrin aHelpText = OUString::number(m_xTreeView->iter_n_children(rEntry)) + " " + m_xTreeView->get_text(rEntry); } - else if (m_aRootNodes[ScContentId::NOTE] && m_xTreeView->iter_compare(*xParent, *m_aRootNodes[ScContentId::NOTE]) == 0) + else if (m_aRootNodes[ScContentId::NOTE] && xParent->equal(*m_aRootNodes[ScContentId::NOTE])) { aHelpText = m_xTreeView->get_text(rEntry); // notes as help text } - else if (m_aRootNodes[ScContentId::AREALINK] && m_xTreeView->iter_compare(*xParent, *m_aRootNodes[ScContentId::AREALINK]) == 0) + else if (m_aRootNodes[ScContentId::AREALINK] && xParent->equal(*m_aRootNodes[ScContentId::AREALINK])) { auto nIndex = GetChildIndex(&rEntry); if (nIndex != SC_CONTENT_NOCHILD) @@ -1386,8 +1386,8 @@ void ScContentTree::ToggleRoot() // after selection { if (!m_aRootNodes[static_cast<ScContentId>(i)]) continue; - if ((m_xTreeView->iter_compare(*xEntry, *m_aRootNodes[static_cast<ScContentId>(i)]) == 0) || - (xParent && m_xTreeView->iter_compare(*xParent, *m_aRootNodes[static_cast<ScContentId>(i)]) == 0)) + if (xEntry->equal(*m_aRootNodes[static_cast<ScContentId>(i)]) || + (xParent && xParent->equal(*m_aRootNodes[static_cast<ScContentId>(i)]))) { nNew = static_cast<ScContentId>(i); } diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 70d997234515..0ca8472c9e86 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -528,7 +528,7 @@ sal_Int8 CustomAnimationList::ExecuteDrop(const ExecuteDropEvent& rEvt) = mxTreeView->get_dest_row_at_pos(rEvt.maPosPixel, true); const bool bMovingEffect = ( mxDndEffectDragging != nullptr ); - const bool bMoveNotSelf = !xDndEffectInsertBefore || (mxDndEffectDragging && mxTreeView->iter_compare(*xDndEffectInsertBefore, *mxDndEffectDragging) != 0); + const bool bMoveNotSelf = !xDndEffectInsertBefore || (mxDndEffectDragging && !xDndEffectInsertBefore->equal(*mxDndEffectDragging)); const bool bHaveSequence(mpMainSequence); if( bMovingEffect && bMoveNotSelf && bHaveSequence ) diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index c7ebdbd1df05..73c8b515bade 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -160,7 +160,7 @@ bool SdPageObjsTLV::HasSelectedChildren( std::u16string_view rName ) m_xTreeView->selected_foreach([this, &bChildren, &xEntry](weld::TreeIter& rEntry){ std::unique_ptr<weld::TreeIter> xParent(m_xTreeView->make_iterator(&rEntry)); while (!bChildren && m_xTreeView->iter_parent(*xParent)) - bChildren = m_xTreeView->iter_compare(*xParent, *xEntry) == 0; + bChildren = xParent->equal(*xEntry); return bChildren; }); @@ -552,8 +552,7 @@ sal_Int8 SdPageObjsTLVDropTarget::AcceptDrop(const AcceptDropEvent& rEvt) std::unique_ptr<weld::TreeIter> xTargetParent(m_rTreeView.make_iterator(xTarget.get())); while (m_rTreeView.get_iter_depth(*xTargetParent) > 1) { - if (!m_rTreeView.iter_parent(*xTargetParent) || - m_rTreeView.iter_compare(*xSource, *xTargetParent) == 0) + if (!m_rTreeView.iter_parent(*xTargetParent) || xSource->equal(*xTargetParent)) return DND_ACTION_NONE; } @@ -564,7 +563,7 @@ sal_Int8 SdPageObjsTLVDropTarget::AcceptDrop(const AcceptDropEvent& rEvt) m_rTreeView.iter_parent(*xTargetPage); while (m_rTreeView.get_iter_depth(*xSourcePage)) m_rTreeView.iter_parent(*xSourcePage); - if (m_rTreeView.iter_compare(*xTargetPage, *xSourcePage) != 0) + if (!xTargetPage->equal(*xSourcePage)) return DND_ACTION_NONE; return DND_ACTION_MOVE; @@ -589,8 +588,7 @@ sal_Int8 SdPageObjsTLVDropTarget::ExecuteDrop( const ExecuteDropEvent& rEvt ) if (!xTarget) return DND_ACTION_NONE; - auto nIterCompare = m_rTreeView.iter_compare(*xSource, *xTarget); - if (nIterCompare == 0) + if (xSource->equal(*xTarget)) { // drop position is the same as source position return DND_ACTION_NONE; diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 7d3d7335c685..3c3b9c5dfe46 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1119,7 +1119,7 @@ IMPL_LINK(FmFilterNavigator, EditedEntryHdl, const IterString&, rIterString, boo const weld::TreeIter& rIter = rIterString.first; const OUString& rNewText = rIterString.second; - assert(m_xEditingCurrently && m_xTreeView->iter_compare(rIter, *m_xEditingCurrently) == 0 && + assert(m_xEditingCurrently && rIter.equal(*m_xEditingCurrently) && "FmFilterNavigator::EditedEntry: suspicious entry!"); m_xEditingCurrently.reset(); @@ -1350,7 +1350,7 @@ void FmFilterNavigator::Remove(FmFilterData const * pItem) if (!xEntry) return; - if (m_xEditingCurrently && m_xTreeView->iter_compare(*xEntry, *m_xEditingCurrently) == 0) + if (m_xEditingCurrently && xEntry->equal(*m_xEditingCurrently)) EndEditing(); m_xTreeView->remove(*xEntry); diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx index 9694b57ab1ba..e45cc4573009 100644 --- a/svx/source/form/fmexch.cxx +++ b/svx/source/form/fmexch.cxx @@ -206,7 +206,7 @@ namespace svxform ::std::vector< sal_uInt32 > aCurrentPath; std::unique_ptr<weld::TreeIter> xLoop(pTreeBox->make_iterator(rCurrentEntry.get())); - while (pTreeBox->iter_compare(*xLoop, *pRoot) != 0) + while (!xLoop->equal(*pRoot)) { aCurrentPath.push_back(pTreeBox->get_iter_index_in_parent(*xLoop)); bool bLoop = pTreeBox->iter_parent(*xLoop); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 60c00560f59a..6b1bc58e91e1 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -732,7 +732,7 @@ namespace svxform { // bHasHiddenControlsFormat means that only hidden controls are part of the data // hidden controls can be copied to a form only - if (m_xTreeView->iter_compare(*_pTargetEntry, *m_xRootEntry) == 0 || !IsFormEntry(*_pTargetEntry)) + if (_pTargetEntry->equal(*m_xRootEntry) || !IsFormEntry(*_pTargetEntry)) return DND_ACTION_NONE; return bSelfSource ? ( DND_ACTION_COPYMOVE & _nAction ) : DND_ACTION_COPY; @@ -811,18 +811,18 @@ namespace svxform for (const auto& rCurrent : rDropped) { // test for 0) - if (m_xTreeView->iter_compare(*rCurrent, *m_xRootEntry) == 0) + if (rCurrent->equal(*m_xRootEntry)) return DND_ACTION_NONE; std::unique_ptr<weld::TreeIter> xCurrentParent(m_xTreeView->make_iterator(rCurrent.get())); m_xTreeView->iter_parent(*xCurrentParent); // test for 1) - if (m_xTreeView->iter_compare(*_pTargetEntry, *xCurrentParent) == 0) + if (_pTargetEntry->equal(*xCurrentParent)) return DND_ACTION_NONE; // test for 2) - if (m_xTreeView->iter_compare(*rCurrent, *_pTargetEntry) == 0) + if (rCurrent->equal(*_pTargetEntry)) return DND_ACTION_NONE; // test for 5) @@ -833,8 +833,8 @@ namespace svxform if (IsFormEntry(*rCurrent)) { auto aIter = std::find_if(arrDropAncestors.begin(), arrDropAncestors.end(), - [this, &rCurrent](const auto& rElem) { - return m_xTreeView->iter_compare(*rElem, *rCurrent) == 0; + [&rCurrent](const auto& rElem) { + return rElem->equal(*rCurrent); }); if ( aIter != arrDropAncestors.end() ) @@ -843,7 +843,7 @@ namespace svxform else if (IsFormComponentEntry(*rCurrent)) { // test for 4) - if (m_xTreeView->iter_compare(*_pTargetEntry, *m_xRootEntry) == 0) + if (_pTargetEntry->equal(*m_xRootEntry)) return DND_ACTION_NONE; } } @@ -893,7 +893,7 @@ namespace svxform #ifdef DBG_UTIL DBG_ASSERT( bHasHiddenControlsFormat, "NavigatorTree::implExecuteDataTransfer: copy allowed for hidden controls only!" ); #endif - DBG_ASSERT( _pTargetEntry && m_xTreeView->iter_compare(*_pTargetEntry, *m_xRootEntry) != 0 && IsFormEntry( *_pTargetEntry ), + DBG_ASSERT( _pTargetEntry && !_pTargetEntry->equal(*m_xRootEntry) && IsFormEntry( *_pTargetEntry ), "NavigatorTree::implExecuteDataTransfer: should not be here!" ); // implAcceptDataTransfer should have caught both cases @@ -1184,8 +1184,8 @@ namespace svxform if (doingKeyboardCut()) { auto aIter = std::find_if(m_aCutEntries.begin(), m_aCutEntries.end(), - [this, pTypedEntry](const auto& rElem) { - return m_xTreeView->iter_compare(*rElem, *pTypedEntry) == 0; + [pTypedEntry](const auto& rElem) { + return rElem->equal(*pTypedEntry); }); if (aIter != m_aCutEntries.end()) m_aCutEntries.erase(aIter); @@ -1700,7 +1700,7 @@ namespace svxform m_xTreeView->selected_foreach([this, sdiHow](weld::TreeIter& rSelectionLoop){ // count different elements - if (m_xTreeView->iter_compare(rSelectionLoop, *m_xRootEntry) == 0) + if (rSelectionLoop.equal(*m_xRootEntry)) m_bRootSelected = true; else { @@ -1717,7 +1717,7 @@ namespace svxform if (sdiHow == SDI_NORMALIZED) { // don't take something with a selected ancestor - if (m_xTreeView->iter_compare(rSelectionLoop, *m_xRootEntry) == 0) + if (rSelectionLoop.equal(*m_xRootEntry)) m_arrCurrentSelection.emplace(m_xTreeView->make_iterator(&rSelectionLoop)); else { @@ -1733,7 +1733,7 @@ namespace svxform break; else { - if (m_xTreeView->iter_compare(*xParentLoop, *m_xRootEntry) == 0) + if (xParentLoop->equal(*m_xRootEntry)) { // until root (exclusive), there was no selected parent -> entry belongs to normalized list m_arrCurrentSelection.emplace(m_xTreeView->make_iterator(&rSelectionLoop)); @@ -1847,7 +1847,7 @@ namespace svxform for (auto& rSelectionLoop : m_arrCurrentSelection) { // When form selection, mark all controls of form - if (IsFormEntry(*rSelectionLoop) && m_xTreeView->iter_compare(*rSelectionLoop, *m_xRootEntry) != 0) + if (IsFormEntry(*rSelectionLoop) && !rSelectionLoop->equal(*m_xRootEntry)) MarkViewObj(weld::fromId<FmFormData*>(m_xTreeView->get_id(*rSelectionLoop)), false/*deep*/); // When control selection, mark Control-SdrObjects diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 0d729fc38625..e6f45afacd61 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1404,7 +1404,7 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool) { if (!m_xOverlayCompareEntry) m_xOverlayCompareEntry.reset(m_xTreeView->make_iterator().release()); - else if (m_xTreeView->iter_compare(*xEntry, *m_xOverlayCompareEntry) == 0) + else if (xEntry->equal(*m_xOverlayCompareEntry)) return false; // The entry under the mouse has not changed. m_xTreeView->copy_iterator(*xEntry, *m_xOverlayCompareEntry); BringEntryToAttention(*xEntry); @@ -4257,7 +4257,7 @@ void SwContentTree::ExecCommand(std::u16string_view rCmd, bool bOutlineWithChild std::unique_ptr<weld::TreeIter> xParent(m_xTreeView->make_iterator(&rEntry)); for (bool bParent = m_xTreeView->iter_parent(*xParent); bParent; bParent = m_xTreeView->iter_parent(*xParent)) { - if (m_xTreeView->iter_compare(*selected.back(), *xParent) == 0) + if (selected.back()->equal(*xParent)) { return false; } @@ -4692,7 +4692,7 @@ static void lcl_SelectByContentTypeAndAddress(SwContentTree* pThis, weld::TreeVi // get first selected for comparison std::unique_ptr<weld::TreeIter> xFirstSelected = rContentTree.get_selected(); if (rContentTree.count_selected_rows() != 1 || !xFirstSelected || - rContentTree.iter_compare(*xIter, *xFirstSelected) != 0) + !xIter->equal(*xFirstSelected)) { // unselect all entries and make passed entry visible and selected rContentTree.set_cursor(*xIter); @@ -4730,7 +4730,7 @@ static void lcl_SelectByContentTypeAndName(SwContentTree* pThis, weld::TreeView& // get first selected for comparison std::unique_ptr<weld::TreeIter> xFirstSelected = rContentTree.get_selected(); if (rContentTree.count_selected_rows() != 1 || !xFirstSelected || - rContentTree.iter_compare(*xIter, *xFirstSelected) != 0) + !xIter->equal(*xFirstSelected)) { // unselect all entries and make passed entry visible and selected rContentTree.set_cursor(*xIter); @@ -5060,7 +5060,7 @@ void SwContentTree::UpdateTracking() std::unique_ptr<weld::TreeIter> xFirstSelected = m_xTreeView->get_selected(); // only select if not already selected or tree has multiple entries selected if (m_xTreeView->count_selected_rows() != 1 || !xFirstSelected || - m_xTreeView->iter_compare(rEntry, *xFirstSelected) != 0) + !rEntry.equal(*xFirstSelected)) { if (m_nOutlineTracking == 2) // focused outline tracking { @@ -5250,7 +5250,7 @@ static bool lcl_IsSelectedCompareByContentTypeAndAddress(const weld::TreeIter& r break; } if (ptr == p) - return rContentTree.iter_compare(*xIter, rEntry) == 0; + return xIter->equal(rEntry); } return false; } @@ -5281,7 +5281,7 @@ static bool lcl_IsSelectedCompareByContentTypeAndName(const weld::TreeIter& rEnt { if (rName == rContentTree.get_text(*xIter)) { - if (rContentTree.iter_compare(*xIter, rEntry) == 0) + if (xIter->equal(rEntry)) return true; } }
