diff options
Diffstat (limited to 'xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx')
-rw-r--r-- | xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx index 00a97a9cc3fa..6a7f4c7cac73 100644 --- a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx +++ b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx @@ -115,22 +115,16 @@ bool UnoInterfaceToUniqueIdentifierMapper::findReference( const Reference< XInte { uno::Reference< uno::XInterface > xRef( rInterface, uno::UNO_QUERY ); - rIter = maEntries.begin(); - const IdMap_t::const_iterator aEnd( maEntries.end() ); - while( rIter != aEnd ) - { + rIter = std::find_if(maEntries.begin(), aEnd, [&xRef](const IdMap_t::value_type& rItem) { // The Reference == operator, does a repeated queryInterface on // this to ensure we got the right XInterface base-class. However, // we can be sure that this has been done already by the time we // get to here. - if( (*rIter).second.get() == xRef.get() ) - return true; - - ++rIter; - } + return rItem.second.get() == xRef.get(); + }); - return false; + return rIter != aEnd; } bool UnoInterfaceToUniqueIdentifierMapper::findIdentifier( const OUString& rIdentifier, IdMap_t::const_iterator& rIter ) const |