diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-08-27 08:26:15 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-08-27 08:26:15 +0200 |
commit | 06c842301ddfbe9e0cc390bff8a0656d80dee2bd (patch) | |
tree | a2143fc87b6e4043da6669b7dca38f0cf11cef79 /svtools/source/control/toolbarmenuacc.cxx | |
parent | fb0bc00e48666c5e2863a9e78623460ee54215cc (diff) |
Use std::find().
Change-Id: Ie302038c5c9e8771bb27be50081788d6545aef5a
Diffstat (limited to 'svtools/source/control/toolbarmenuacc.cxx')
-rw-r--r-- | svtools/source/control/toolbarmenuacc.cxx | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 1ad9cbf91711..da3ebdc04ae3 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -330,18 +330,9 @@ void SAL_CALL ToolbarMenuAcc::removeAccessibleEventListener( const Reference< XA if( rxListener.is() ) { - EventListenerVector::const_iterator aEnd = mxEventListeners.end(); - - for(EventListenerVector::iterator aIter = mxEventListeners.begin(); - aIter != aEnd; - ++aIter) - { - if( *aIter == rxListener ) - { - mxEventListeners.erase(aIter); - break; - } - } + EventListenerVector::iterator aIter = std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener); + if (aIter != mxEventListeners.end()) + mxEventListeners.erase(aIter); } } @@ -831,18 +822,9 @@ void SAL_CALL ToolbarMenuEntryAcc::removeAccessibleEventListener( const Referenc if( rxListener.is() ) { - EventListenerVector::const_iterator aEnd = mxEventListeners.end(); - - for (EventListenerVector::iterator aIter = mxEventListeners.begin(); - aIter != aEnd; - ++aIter) - { - if( *aIter == rxListener ) - { - mxEventListeners.erase( aIter ); - break; - } - } + EventListenerVector::iterator aIter = std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener); + if (aIter != mxEventListeners.end()) + mxEventListeners.erase(aIter); } } |