comphelper/source/container/embeddedobjectcontainer.cxx | 2 +- comphelper/source/property/ChainablePropertySetInfo.cxx | 2 +- comphelper/source/property/MasterPropertySetInfo.cxx | 4 ++-- comphelper/source/property/propertysetinfo.cxx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit a3df4852b8cc1a1445fdc1fe0057b94a5405376d Author: Steven Casey (SMCode) <st...@caseycontact.com> AuthorDate: Mon Feb 12 22:16:29 2024 -0800 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Tue Feb 13 14:03:56 2024 +0100 tdf#158237 comphelper: Use C++20 contains() instead of find() and end() Change-Id: Iadb1203b1bd3f560c09ee38944c50190eed5735f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163269 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 23915d3e13ab..d20e99d6632b 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -248,7 +248,7 @@ bool EmbeddedObjectContainer::HasEmbeddedObject( const OUString& rName ) bool EmbeddedObjectContainer::HasEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj ) const { - return pImpl->maObjectToNameMap.find(xObj) != pImpl->maObjectToNameMap.end(); + return pImpl->maObjectToNameMap.contains(xObj); } bool EmbeddedObjectContainer::HasInstantiatedEmbeddedObject( const OUString& rName ) diff --git a/comphelper/source/property/ChainablePropertySetInfo.cxx b/comphelper/source/property/ChainablePropertySetInfo.cxx index 10b4d5fda622..4515e5c4314b 100644 --- a/comphelper/source/property/ChainablePropertySetInfo.cxx +++ b/comphelper/source/property/ChainablePropertySetInfo.cxx @@ -31,7 +31,7 @@ ChainablePropertySetInfo::ChainablePropertySetInfo( PropertyInfo const * pMap ) for( ; !pMap->maName.isEmpty(); ++pMap ) { SAL_WARN_IF( - maMap.find(pMap->maName) != maMap.end(), + maMap.contains(pMap->maName), "comphelper", "Duplicate property name \"" << pMap->maName << "\""); maMap[pMap->maName] = pMap; } diff --git a/comphelper/source/property/MasterPropertySetInfo.cxx b/comphelper/source/property/MasterPropertySetInfo.cxx index db8ddb769975..4040b479a05c 100644 --- a/comphelper/source/property/MasterPropertySetInfo.cxx +++ b/comphelper/source/property/MasterPropertySetInfo.cxx @@ -31,7 +31,7 @@ MasterPropertySetInfo::MasterPropertySetInfo( PropertyInfo const * pMap ) for ( ; !pMap->maName.isEmpty(); ++pMap ) { SAL_WARN_IF( - maMap.find(pMap->maName) != maMap.end(), + maMap.contains(pMap->maName), "comphelper", "Duplicate property name \"" << pMap->maName << "\""); maMap[pMap->maName] = new PropertyData ( 0, pMap ); } @@ -52,7 +52,7 @@ void MasterPropertySetInfo::add( PropertyInfoHash &rHash, sal_uInt8 nMapId ) for( const auto& rObj : rHash ) { SAL_WARN_IF( - maMap.find(rObj.first) != maMap.end(), + maMap.contains(rObj.first), "comphelper", "Duplicate property name \"" << rObj.first << "\""); maMap[rObj.first] = new PropertyData ( nMapId, rObj.second ); } diff --git a/comphelper/source/property/propertysetinfo.cxx b/comphelper/source/property/propertysetinfo.cxx index d288ae21263f..e8bcdcae7530 100644 --- a/comphelper/source/property/propertysetinfo.cxx +++ b/comphelper/source/property/propertysetinfo.cxx @@ -114,7 +114,7 @@ Property SAL_CALL PropertySetInfo::getPropertyByName( const OUString& aName ) sal_Bool SAL_CALL PropertySetInfo::hasPropertyByName( const OUString& aName ) { - return maPropertyMap.find( aName ) != maPropertyMap.end(); + return maPropertyMap.contains( aName ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */