chart2/source/controller/main/CommandDispatchContainer.cxx | 4 ++-- editeng/source/editeng/impedit3.cxx | 2 +- include/o3tl/sorted_vector.hxx | 4 ++-- sc/source/core/tool/recursionhelper.cxx | 2 +- sc/source/filter/excel/xetable.cxx | 2 +- sd/source/core/sdpage.cxx | 2 +- sw/source/core/access/accmap.cxx | 4 ++-- sw/source/core/doc/docnew.cxx | 2 +- sw/source/core/undo/rolbck.cxx | 4 ++-- sw/source/core/view/viewpg.cxx | 4 ++-- sw/source/core/view/vprint.cxx | 2 +- vcl/jsdialog/enabled.cxx | 2 +- vcl/source/app/salvtables.cxx | 4 ++-- vcl/unx/gtk3/gtkinst.cxx | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-)
New commits: commit 645571870ba449391ddbb4fcb5dad747177a633d Author: Caolán McNamara <[email protected]> AuthorDate: Tue Dec 9 16:28:51 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Dec 11 12:03:02 2025 +0100 rename o3tl::sorted_vector::count() to contains() arguably more in line with contemporary naming Change-Id: I25b194b12a17e79bc6bc1052320a6b2497c4107f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195313 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195366 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx index e76afa295b12..b1adafced570 100644 --- a/chart2/source/controller/main/CommandDispatchContainer.cxx +++ b/chart2/source/controller/main/CommandDispatchContainer.cxx @@ -113,7 +113,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( m_aToBeDisposedDispatches.push_back(pDispatch); return pDispatch; } - if (s_aContainerDocumentCommands.count(rURL.Path) > 0) + if (s_aContainerDocumentCommands.contains(rURL.Path)) { // ToDo: can those dispatches be cached? return cacheIt(getContainerDispatchForURL(xModel->getCurrentController(), rURL)); @@ -122,7 +122,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( if (m_xChartDispatcher.is() && (m_xChartDispatcher->commandHandled(rURL.Complete) - || m_aAdditionalChartCommands.count(rURL.Path) > 0)) + || m_aAdditionalChartCommands.contains(rURL.Path))) return cacheIt(m_xChartDispatcher); // #i12587# support for shapes in chart diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 942622090103..fca52b933676 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -395,7 +395,7 @@ void ImpEditEngine::FormatDoc() if (!aRepaintParagraphList.empty()) { auto CombineRepaintParasAreas = [&](const LineAreaInfo& rInfo) { - if (aRepaintParagraphList.count(rInfo.nPortion)) + if (aRepaintParagraphList.contains(rInfo.nPortion)) maInvalidRect.Union(rInfo.aArea); return CallbackResult::Continue; }; diff --git a/include/o3tl/sorted_vector.hxx b/include/o3tl/sorted_vector.hxx index 3d26034e2a0e..7afcf4782c25 100644 --- a/include/o3tl/sorted_vector.hxx +++ b/include/o3tl/sorted_vector.hxx @@ -221,9 +221,9 @@ public: return (ret.second) ? ret.first : m_vector.end(); } - size_type count(const Value& v) const + bool contains(const Value& v) const { - return find(v) != end() ? 1 : 0; + return find(v) != end(); } bool operator==(const sorted_vector & other) const diff --git a/sc/source/core/tool/recursionhelper.cxx b/sc/source/core/tool/recursionhelper.cxx index 59601f37a0a6..3055fc78d3d8 100644 --- a/sc/source/core/tool/recursionhelper.cxx +++ b/sc/source/core/tool/recursionhelper.cxx @@ -230,7 +230,7 @@ void ScRecursionHelper::CleanTemporaryGroupCells() bool ScRecursionHelper::CheckFGIndependence(ScFormulaCellGroup* pFG) { - if (pFGSet && pFGSet->count(pFG)) + if (pFGSet && pFGSet->contains(pFG)) { bGroupsIndependent = false; return false; diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 3b3981f118c5..e28f6b6e657f 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -262,7 +262,7 @@ XclExpShrfmlaRef XclExpShrfmlaBuffer::CreateOrExtendShrfmla( return xRec; // Check to see if this shared formula contains any tokens that Excel's shared formula cannot handle. - if (maBadTokens.count(pShrdScTokArr) > 0) + if (maBadTokens.contains(pShrdScTokArr)) // Already on the black list. Skip it. return xRec; diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 6eb5138ca154..a5cea90e493f 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1723,7 +1723,7 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, bool bInit, bool bCreate ) rtl::Reference<SdrObject> pObj; while( (pObj = maPresentationShapeList.getNextShape()) ) { - if( aUsedPresentationObjects.count(pObj.get()) == 0 ) + if (!aUsedPresentationObjects.contains(pObj.get())) { if( pObj->IsEmptyPresObj() ) diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 33f1e5b31d13..19c3e9d40421 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1273,7 +1273,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() { m_setParaAdd.insert(pAccPara); } - else if(m_setParaAdd.count(pAccPara) == 0) + else if (!m_setParaAdd.contains(pAccPara)) { m_setParaRemove.insert(pAccPara); } @@ -1531,7 +1531,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa || xParaContext->getAccessibleRole() == AccessibleRole::BLOCK_QUOTE)) { SwAccessibleParagraph* pAccPara = static_cast< SwAccessibleParagraph *>(xPara.get()); - if (m_setParaAdd.count(pAccPara) == 0 ) + if (!m_setParaAdd.contains(pAccPara)) { m_setParaRemove.insert(pAccPara); } diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 5b8120ca973d..6df58032f473 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -977,7 +977,7 @@ static bool lcl_PageDescOrFollowContainsHeaderFooter(const SwPageDesc& rPageDesc // remember already checked page descs to avoid cycle o3tl::sorted_vector<const SwPageDesc*> aCheckedPageDescs; const SwPageDesc* pCurPageDesc = &rPageDesc; - while (aCheckedPageDescs.count(pCurPageDesc) == 0) + while (!aCheckedPageDescs.contains(pCurPageDesc)) { const SwFrameFormat& rMaster = pCurPageDesc->GetMaster(); if (rMaster.GetHeader().IsActive() || rMaster.GetFooter().IsActive()) diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index c961e6d539b6..7d10a2624ec0 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -857,7 +857,7 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( for (SfxItemIter aIter(rSet); !aIter.IsAtEnd(); aIter.NextItem()) { // check if Item is intended to be contained - if (rSetArr.count(aIter.GetCurWhich())) + if (rSetArr.contains(aIter.GetCurWhich())) { // do include item, but take care of some 'special' cases switch (aIter.GetCurWhich()) @@ -1436,7 +1436,7 @@ void SwRegHistory::SwClientNotify(const SwModify&, const SfxHint& rHint) } else if (const SfxPoolItem* pItem = SfxItemIter(rSet).GetCurItem()) { - if ( m_WhichIdSet.count( pItem->Which() ) ) + if (m_WhichIdSet.contains(pItem->Which())) { pNewHstr.reset( new SwHistorySetFormat( pItem, m_nNodeIndex ) ); } diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx index fd9b0969d88c..535fb40000d3 100644 --- a/sw/source/core/view/viewpg.cxx +++ b/sw/source/core/view/viewpg.cxx @@ -79,8 +79,8 @@ void SwViewShell::PrintProspect( std::pair< sal_Int32, sal_Int32 > rPagesToPrint = rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ]; - OSL_ENSURE( rPagesToPrint.first == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" ); - OSL_ENSURE( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" ); + OSL_ENSURE( rPagesToPrint.first == -1 || rPrintData.GetRenderData().GetValidPagesSet().contains( rPagesToPrint.first ), "first Page not valid" ); + OSL_ENSURE( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().contains( rPagesToPrint.second ), "second Page not valid" ); // create a new shell for the printer SwViewShell aShell( *this, nullptr, pPrinter ); diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index ac4d85997fd0..337e6e3fbd37 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -490,7 +490,7 @@ bool SwViewShell::PrintOrPDFExport( const sal_Int32 nPage = rPrintData.GetRenderData().GetPagesToPrint()[ nRenderer ]; OSL_ENSURE( nPage < 0 || - rPrintData.GetRenderData().GetValidPagesSet().count( nPage ) == 1, + rPrintData.GetRenderData().GetValidPagesSet().contains(nPage), "SwViewShell::PrintOrPDFExport: nPage not valid" ); SwViewShell *const pViewSh2 = (nPage < 0) ? rPrintData.GetRenderData().m_pPostItShell.get()// post-it page diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 941813526c72..e2377624cae6 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -634,7 +634,7 @@ bool completeWriterDialogList(const o3tl::sorted_vector<OUString>& entries) { for (const auto& entry : SwriterDialogList) { - if (entries.find(OUString(entry)) == entries.end()) + if (!entries.contains(OUString(entry))) return false; } return true; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 84cf51936c19..e3b50b9f1dbe 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3552,7 +3552,7 @@ void SalInstanceTreeView::set_font_color(SvTreeListEntry* pEntry, const Color& r void SalInstanceTreeView::AddStringItem(SvTreeListEntry* pEntry, const OUString& rStr, int nCol) { auto xCell = std::make_unique<SvLBoxString>(rStr); - if (m_aCustomRenders.count(nCol)) + if (m_aCustomRenders.contains(nCol)) xCell->SetCustomRender(); pEntry->AddItem(std::move(xCell)); } @@ -4674,7 +4674,7 @@ bool SalInstanceTreeView::get_row_expanded(const weld::TreeIter& rIter) const bool SalInstanceTreeView::get_children_on_demand(const weld::TreeIter& rIter) const { const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter); - if (m_aExpandingPlaceHolderParents.count(rVclIter.iter)) + if (m_aExpandingPlaceHolderParents.contains(rVclIter.iter)) return true; return GetPlaceHolderChild(rVclIter.iter) != nullptr; } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 2d72f83fbaee..a6f8527eddc6 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -14171,7 +14171,7 @@ private: bool child_is_placeholder(GtkInstanceTreeIter& rGtkIter) const { GtkTreePath* pPath = gtk_tree_model_get_path(m_pTreeModel, &rGtkIter.iter); - bool bExpanding = m_aExpandingPlaceHolderParents.count(pPath); + bool bExpanding = m_aExpandingPlaceHolderParents.contains(pPath); gtk_tree_path_free(pPath); if (bExpanding) return true;
