[Libreoffice-commits] core.git: svtools/source
Jan Holesovsky
kendy at suse.cz
Mon Aug 26 23:30:29 PDT 2013
svtools/source/control/toolbarmenuacc.cxx | 30 ++++++------------------------
1 file changed, 6 insertions(+), 24 deletions(-)
New commits:
commit 06c842301ddfbe9e0cc390bff8a0656d80dee2bd
Author: Jan Holesovsky <kendy at suse.cz>
Date: Tue Aug 27 08:26:15 2013 +0200
Use std::find().
Change-Id: Ie302038c5c9e8771bb27be50081788d6545aef5a
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index 1ad9cbf..da3ebdc 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);
}
}
More information about the Libreoffice-commits
mailing list