tdf#158237 Use C++20 contains() instead of find() and end()
Change-Id: I6688c62b13e9e1dce5f6cd077fafc1d5a6adbae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192660 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
committed by
Ilmari Lauhakangas
parent
8ca67cbef0
commit
ed663ada46
@@ -1993,7 +1993,7 @@ bool SVGFilter::implExportPage( std::u16string_view sPageId,
|
||||
SvXMLElementExport aExp(*mpSVGExport, u"g"_ustr, true, true);
|
||||
|
||||
// In case the page has a background object we append it .
|
||||
if( mpObjects->find( rxPage ) != mpObjects->end() )
|
||||
if( mpObjects->contains( rxPage ) )
|
||||
{
|
||||
const GDIMetaFile& rMtf = (*mpObjects)[ rxPage ].GetRepresentation();
|
||||
if( rMtf.GetActionSize() )
|
||||
@@ -2133,7 +2133,7 @@ bool SVGFilter::implExportShape( const Reference< css::drawing::XShape >& rxShap
|
||||
}
|
||||
}
|
||||
|
||||
if( !bRet && mpObjects->find( rxShape ) != mpObjects->end() )
|
||||
if( !bRet && mpObjects->contains( rxShape ) )
|
||||
{
|
||||
css::awt::Rectangle aBoundRect;
|
||||
const GDIMetaFile& rMtf = (*mpObjects)[ rxShape ].GetRepresentation();
|
||||
@@ -2563,7 +2563,7 @@ void SVGFilter::implCreateObjectsFromBackground( const Reference< css::drawing::
|
||||
bBitmapFound = true; // the subsequent bitmaps are still the same just translated
|
||||
|
||||
BitmapChecksum nChecksum = GetBitmapChecksum( pAction );
|
||||
if( maBitmapActionMap.find( nChecksum ) == maBitmapActionMap.end() )
|
||||
if( !maBitmapActionMap.contains( nChecksum ) )
|
||||
{
|
||||
Point aPos; // (0, 0)
|
||||
Size aSize;
|
||||
@@ -2686,7 +2686,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void )
|
||||
OSL_FAIL( "error: !mCreateOjectsCurrentMasterPage.is()" );
|
||||
return;
|
||||
}
|
||||
bool bHasCharSetMap = mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) != mTextFieldCharSets.end();
|
||||
const bool bHasCharSetMap = mTextFieldCharSets.contains( mCreateOjectsCurrentMasterPage );
|
||||
|
||||
static constexpr OUString aHeaderId( NSPREFIX "header-field"_ustr );
|
||||
static constexpr OUString aFooterId( aOOOAttrFooterField );
|
||||
@@ -2700,21 +2700,21 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void )
|
||||
pCharSetMap = &( mTextFieldCharSets[ mCreateOjectsCurrentMasterPage ] );
|
||||
}
|
||||
const SvxFieldData* pField = pInfo->GetField().GetField();
|
||||
if( bHasCharSetMap && ( pField->GetClassId() == text::textfield::Type::PRESENTATION_HEADER ) && ( pCharSetMap->find( aHeaderId ) != pCharSetMap->end() ) )
|
||||
if( bHasCharSetMap && ( pField->GetClassId() == text::textfield::Type::PRESENTATION_HEADER ) && pCharSetMap->contains( aHeaderId ) )
|
||||
{
|
||||
pCharSet = &( (*pCharSetMap)[ aHeaderId ] );
|
||||
}
|
||||
else if( bHasCharSetMap && ( pField->GetClassId() == text::textfield::Type::PRESENTATION_FOOTER ) && ( pCharSetMap->find( aFooterId ) != pCharSetMap->end() ) )
|
||||
else if( bHasCharSetMap && ( pField->GetClassId() == text::textfield::Type::PRESENTATION_FOOTER ) && pCharSetMap->contains( aFooterId ) )
|
||||
{
|
||||
pCharSet = &( (*pCharSetMap)[ aFooterId ] );
|
||||
}
|
||||
else if( pField->GetClassId() == text::textfield::Type::PRESENTATION_DATE_TIME )
|
||||
{
|
||||
if( bHasCharSetMap && ( pCharSetMap->find( aDateTimeId ) != pCharSetMap->end() ) )
|
||||
if( bHasCharSetMap && pCharSetMap->contains( aDateTimeId ) )
|
||||
{
|
||||
pCharSet = &( (*pCharSetMap)[ aDateTimeId ] );
|
||||
}
|
||||
if( bHasCharSetMap && ( pCharSetMap->find( aVariableDateTimeId ) != pCharSetMap->end() ) && !(*pCharSetMap)[ aVariableDateTimeId ].empty() )
|
||||
if( bHasCharSetMap && pCharSetMap->contains( aVariableDateTimeId ) && !(*pCharSetMap)[ aVariableDateTimeId ].empty() )
|
||||
{
|
||||
SvxDateFormat eDateFormat = SvxDateFormat::B, eCurDateFormat;
|
||||
const UCharSet & aCharSet = (*pCharSetMap)[ aVariableDateTimeId ];
|
||||
@@ -2902,8 +2902,7 @@ void SVGExport::SetEmbeddedBulletGlyph(sal_Unicode cBullet)
|
||||
|
||||
bool SVGExport::IsEmbeddedBulletGlyph(sal_Unicode cBullet) const
|
||||
{
|
||||
auto it = maEmbeddedBulletGlyphs.find(cBullet);
|
||||
return it != maEmbeddedBulletGlyphs.end();
|
||||
return maEmbeddedBulletGlyphs.contains(cBullet);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -2922,7 +2922,7 @@ void SVGActionWriter::ImplWriteBmp( const Bitmap& rBmp,
|
||||
if( mpEmbeddedBitmapsMap && !mpEmbeddedBitmapsMap->empty())
|
||||
{
|
||||
BitmapChecksum nChecksum = rBmp.GetChecksum();
|
||||
if( mpEmbeddedBitmapsMap->find( nChecksum ) != mpEmbeddedBitmapsMap->end() )
|
||||
if( mpEmbeddedBitmapsMap->contains( nChecksum ) )
|
||||
{
|
||||
// <use transform="translate(?) scale(?)" xlink:ref="?" >
|
||||
OUString sTransform;
|
||||
|
||||
@@ -92,7 +92,7 @@ weld::TreeIter* FuncPage::FillCategoriesMap(const OUString& aCategory, bool bFil
|
||||
if (!bFill)
|
||||
return nullptr;
|
||||
|
||||
if (mCategories.find(aCategory) == mCategories.end())
|
||||
if (!mCategories.contains(aCategory))
|
||||
{
|
||||
mCategories[aCategory] = m_xLbFunction->make_iterator();
|
||||
m_xLbFunction->insert(nullptr, -1, &aCategory, nullptr, nullptr, nullptr, false,
|
||||
@@ -101,10 +101,7 @@ weld::TreeIter* FuncPage::FillCategoriesMap(const OUString& aCategory, bool bFil
|
||||
return mCategories[aCategory].get();
|
||||
}
|
||||
|
||||
bool FuncPage::IsFavourite(sal_uInt16 nFIndex) const
|
||||
{
|
||||
return aFavouritesList.find(nFIndex) != aFavouritesList.end();
|
||||
}
|
||||
bool FuncPage::IsFavourite(sal_uInt16 nFIndex) const { return aFavouritesList.contains(nFIndex); }
|
||||
|
||||
bool FuncPage::UpdateFavouritesList()
|
||||
{
|
||||
@@ -312,7 +309,7 @@ IMPL_LINK_NOARG(FuncPage, SelTreeViewHdl, weld::TreeView&, void)
|
||||
IMPL_LINK_NOARG(FuncPage, DblClkHdl, weld::TreeView&, bool)
|
||||
{
|
||||
const OUString aString = m_xLbFunction->get_selected_text();
|
||||
if (mCategories.find(aString) != mCategories.end())
|
||||
if (mCategories.contains(aString))
|
||||
{
|
||||
const auto& categoryRow = *(mCategories[aString]);
|
||||
if (m_xLbFunction->get_row_expanded(categoryRow))
|
||||
|
||||
@@ -51,7 +51,7 @@ static void checkStyleNames(const OString& aLanguage)
|
||||
const OString& aMsgStr = aPoEntry.getMsgStr();
|
||||
if( aMsgStr.isEmpty() )
|
||||
continue;
|
||||
if( aLocalizedStyleNames.find(aMsgStr) == aLocalizedStyleNames.end() )
|
||||
if( !aLocalizedStyleNames.contains(aMsgStr) )
|
||||
aLocalizedStyleNames[aMsgStr] = 1;
|
||||
else {
|
||||
aLocalizedStyleNames[aMsgStr]++;
|
||||
@@ -63,7 +63,7 @@ static void checkStyleNames(const OString& aLanguage)
|
||||
const OString& aMsgStr = aPoEntry.getMsgStr();
|
||||
if( aMsgStr.isEmpty() )
|
||||
continue;
|
||||
if( aLocalizedNumStyleNames.find(aMsgStr) == aLocalizedNumStyleNames.end() )
|
||||
if( !aLocalizedNumStyleNames.contains(aMsgStr) )
|
||||
aLocalizedNumStyleNames[aMsgStr] = 1;
|
||||
else {
|
||||
aLocalizedNumStyleNames[aMsgStr]++;
|
||||
@@ -171,9 +171,9 @@ static void checkFunctionNames(const OString& aLanguage)
|
||||
const OString& aMsgStr = aPoEntry.getMsgStr();
|
||||
if( aMsgStr.isEmpty() )
|
||||
continue;
|
||||
if( aLocalizedCoreFunctionNames.find(aMsgStr) == aLocalizedCoreFunctionNames.end() )
|
||||
if( !aLocalizedCoreFunctionNames.contains(aMsgStr) )
|
||||
aLocalizedCoreFunctionNames[aMsgStr] = 1;
|
||||
if( aLocalizedFunctionNames.find(aMsgStr) == aLocalizedFunctionNames.end() ) {
|
||||
if( !aLocalizedFunctionNames.contains(aMsgStr) ) {
|
||||
aLocalizedFunctionNames[aMsgStr] = 1;
|
||||
} else {
|
||||
aLocalizedFunctionNames[aMsgStr]++;
|
||||
@@ -205,9 +205,9 @@ static void checkFunctionNames(const OString& aLanguage)
|
||||
OString aMsgStr = aPoEntry.getMsgStr();
|
||||
if( aMsgStr.isEmpty() )
|
||||
continue;
|
||||
if( aLocalizedCoreFunctionNames.find(aMsgStr) != aLocalizedCoreFunctionNames.end() )
|
||||
if( aLocalizedCoreFunctionNames.contains(aMsgStr) )
|
||||
aMsgStr += "_ADD";
|
||||
if( aLocalizedFunctionNames.find(aMsgStr) == aLocalizedFunctionNames.end() ) {
|
||||
if( !aLocalizedFunctionNames.contains(aMsgStr) ) {
|
||||
aLocalizedFunctionNames[aMsgStr] = 1;
|
||||
} else {
|
||||
aLocalizedFunctionNames[aMsgStr]++;
|
||||
|
||||
@@ -457,7 +457,7 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur )
|
||||
}
|
||||
}
|
||||
|
||||
if ( bInsert && ( m_aNodes_localize.find( sName ) != m_aNodes_localize.end() ) )
|
||||
if ( bInsert && m_aNodes_localize.contains( sName ) )
|
||||
InsertL10NElement(pElement);
|
||||
else if ( bInsert && pElement->GetChildList() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user