comphelper/source/container/embeddedobjectcontainer.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 488cd78f3b30f8b43007a3250d0c11fd0416dde9
Author:     AkshayWarrier <[email protected]>
AuthorDate: Sat Jan 20 22:42:58 2024 +0530
Commit:     Hossein <[email protected]>
CommitDate: Tue Feb 13 19:54:07 2024 +0100

    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 <[email protected]>

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

Reply via email to