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 <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195366 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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() )
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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 ) );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user