summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorSteven Casey (SMCode) <steve@caseycontact.com>2024-02-12 22:16:29 -0800
committerTaichi Haradaguchi <20001722@ymail.ne.jp>2024-02-13 14:03:56 +0100
commita3df4852b8cc1a1445fdc1fe0057b94a5405376d (patch)
tree3b55809bdd3d5d6464eb69da82b6367859c6ba8d /comphelper
parent7bea643b8b09e27852dbd68459289873e2989feb (diff)
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 <20001722@ymail.ne.jp>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx2
-rw-r--r--comphelper/source/property/ChainablePropertySetInfo.cxx2
-rw-r--r--comphelper/source/property/MasterPropertySetInfo.cxx4
-rw-r--r--comphelper/source/property/propertysetinfo.cxx2
4 files changed, 5 insertions, 5 deletions
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: */