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 a994ed1355b1dfea28dfe34ae8b7642bf04a8b70 Author: Caolán McNamara <[email protected]> AuthorDate: Tue Dec 9 16:28:51 2025 +0000 Commit: Miklos Vajna <[email protected]> CommitDate: Wed Dec 10 09:32:05 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]> 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 30ccb092ec0f..2b2a9aa4565b 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -481,7 +481,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 bf28b7166e41..68d8458c5589 100644 --- a/include/o3tl/sorted_vector.hxx +++ b/include/o3tl/sorted_vector.hxx @@ -222,9 +222,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 ebf3ebf0ea3b..5812572bc1fc 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1742,7 +1742,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 4dfe6284beb8..cfc6ef491b08 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1339,7 +1339,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); } @@ -1615,7 +1615,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 82306f6f787e..e7848bacb48f 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -983,7 +983,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 ba5ba3f9db6d..0f05a8923c18 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -844,7 +844,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()) @@ -1435,7 +1435,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 02ebd1a69e12..e4079191befe 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 fc1f20a85555..f0411f426660 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 172c7fd35364..dd3508829eff 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -644,7 +644,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 3c4ca0ee9969..2398764d147d 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3646,7 +3646,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)); } @@ -4789,7 +4789,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 88b6e5b8db95..775bd43167be 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -14558,7 +14558,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;
