summaryrefslogtreecommitdiffstats
path: root/comphelper
diff options
context:
space:
mode:
authorAkshayWarrier <aksmen121@gmail.com>2024-01-20 22:42:58 +0530
committerHossein <hossein@libreoffice.org>2024-02-13 19:54:07 +0100
commit488cd78f3b30f8b43007a3250d0c11fd0416dde9 (patch)
treeb303bdecc09a842ba977088d7d05a95f0638da40 /comphelper
parentfix windows --enable-mergelibs build (diff)
downloadcore-488cd78f3b30f8b43007a3250d0c11fd0416dde9.tar.gz
core-488cd78f3b30f8b43007a3250d0c11fd0416dde9.zip
tdf#158237 comphelper: Use C++20 contains() instead of find() and end()
Change-Id: I99c27c2269051c6c145dbfd2ec12790d4bb1d5e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162338 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index d20e99d6632b..a66ac2dec527 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -238,8 +238,7 @@ bool EmbeddedObjectContainer::HasEmbeddedObjects() const
bool EmbeddedObjectContainer::HasEmbeddedObject( const OUString& rName )
{
- auto aIt = pImpl->maNameToObjectMap.find( rName );
- if (aIt != pImpl->maNameToObjectMap.end())
+ if (pImpl->maNameToObjectMap.contains(rName))
return true;
if (!pImpl->mxStorage.is())
return false;
@@ -256,8 +255,7 @@ bool EmbeddedObjectContainer::HasInstantiatedEmbeddedObject( const OUString& rNa
// allows to detect whether the object was already instantiated
// currently the filter instantiate it on loading, so this method allows
// to avoid objects pointing to the same persistence
- auto aIt = pImpl->maNameToObjectMap.find( rName );
- return ( aIt != pImpl->maNameToObjectMap.end() );
+ return pImpl->maNameToObjectMap.contains(rName);
}
OUString EmbeddedObjectContainer::GetEmbeddedObjectName( const css::uno::Reference < css::embed::XEmbeddedObject >& xObj ) const