diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-03-30 18:07:16 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2013-03-30 18:23:37 +0100 |
commit | 0a7c31d2a296ae8898c73777d2edbfb4e8772c7d (patch) | |
tree | a2109af4329f5c097f0ab60cab9c3f342b82e063 /svtools/source/control | |
parent | 6d8416c8b4f1deb76a0598842b5c68dd7621ea62 (diff) |
Prefer prefix ++/-- operators for non-primitive types
Change-Id: I947709235e714a208eff6b57a7eba2f7dd386893
Diffstat (limited to 'svtools/source/control')
-rw-r--r-- | svtools/source/control/toolbarmenuacc.cxx | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 56537b97cee4..7694838759da 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -126,7 +126,6 @@ void ToolbarMenuAcc::FireAccessibleEvent( short nEventId, const Any& rOldValue, if( nEventId ) { EventListenerVector aTmpListeners( mxEventListeners ); - EventListenerVector::const_iterator aIter( aTmpListeners.begin() ); AccessibleEventObject aEvtObject; aEvtObject.EventId = nEventId; @@ -134,7 +133,8 @@ void ToolbarMenuAcc::FireAccessibleEvent( short nEventId, const Any& rOldValue, aEvtObject.NewValue = rNewValue; aEvtObject.OldValue = rOldValue; - while( aIter != aTmpListeners.end() ) + for (EventListenerVector::const_iterator aIter( aTmpListeners.begin() ), aEnd( aTmpListeners.end() ); + aIter != aEnd ; ++aIter) { try { @@ -143,8 +143,6 @@ void ToolbarMenuAcc::FireAccessibleEvent( short nEventId, const Any& rOldValue, catch( Exception& ) { } - - aIter++; } } } @@ -816,19 +814,14 @@ void SAL_CALL ToolbarMenuEntryAcc::addAccessibleEventListener( const Reference< if( rxListener.is() ) { - EventListenerVector::const_iterator aIter( mxEventListeners.begin() ); - bool bFound = false; - - while( !bFound && ( aIter != mxEventListeners.end() ) ) + for (EventListenerVector::const_iterator aIter( mxEventListeners.begin() ), aEnd( mxEventListeners.end() ); + aIter != aEnd; ++aIter ) { if( *aIter == rxListener ) - bFound = true; - else - aIter++; + return; } - - if (!bFound) - mxEventListeners.push_back( rxListener ); + // listener not found so add it + mxEventListeners.push_back( rxListener ); } } |