diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-08-27 07:18:56 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2013-08-27 07:18:56 +0200 |
commit | 6ce6d0a41817c3eb9ec857c478c31594f0673735 (patch) | |
tree | f8c00198589ad5b7c7b54955d1a0d4ab99067ed5 /svtools | |
parent | feb2604291c8b4710fd274307d50fba756cef277 (diff) |
Bin bool + transform while into for loop + add end iterator (3)
Change-Id: I3d22eede61fb7ba15bac6f6130a7a60ec62170dc
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/toolbarmenuacc.cxx | 24 | ||||
-rw-r--r-- | svtools/source/control/valueacc.cxx | 26 |
2 files changed, 23 insertions, 27 deletions
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx index 8c35f91c885b..1ad9cbf91711 100644 --- a/svtools/source/control/toolbarmenuacc.cxx +++ b/svtools/source/control/toolbarmenuacc.cxx @@ -330,18 +330,17 @@ void SAL_CALL ToolbarMenuAcc::removeAccessibleEventListener( const Reference< XA if( rxListener.is() ) { - EventListenerVector::iterator aIter = mxEventListeners.begin(); - bool bFound = false; + EventListenerVector::const_iterator aEnd = mxEventListeners.end(); - while( !bFound && ( aIter != mxEventListeners.end() ) ) + for(EventListenerVector::iterator aIter = mxEventListeners.begin(); + aIter != aEnd; + ++aIter) { if( *aIter == rxListener ) { - mxEventListeners.erase( aIter ); - bFound = true; + mxEventListeners.erase(aIter); + break; } - else - ++aIter; } } } @@ -832,18 +831,17 @@ void SAL_CALL ToolbarMenuEntryAcc::removeAccessibleEventListener( const Referenc if( rxListener.is() ) { - EventListenerVector::iterator aIter = mxEventListeners.begin(); - bool bFound = false; + EventListenerVector::const_iterator aEnd = mxEventListeners.end(); - while( !bFound && ( aIter != mxEventListeners.end() ) ) + for (EventListenerVector::iterator aIter = mxEventListeners.begin(); + aIter != aEnd; + ++aIter) { if( *aIter == rxListener ) { mxEventListeners.erase( aIter ); - bFound = true; + break; } - else - ++aIter; } } } diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 985f9fb586e7..e92b7cafbf80 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -384,18 +384,17 @@ void SAL_CALL ValueSetAcc::removeAccessibleEventListener( const uno::Reference< if( rxListener.is() ) { - ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin(); - sal_Bool bFound = sal_False; + ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aEnd = mxEventListeners.end(); - while( !bFound && ( aIter != mxEventListeners.end() ) ) + for(::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin(); + aIter != aEnd; + ++aIter) { if( *aIter == rxListener ) { - mxEventListeners.erase( aIter ); - bFound = sal_True; + mxEventListeners.erase(aIter); + break; } - else - ++aIter; } } } @@ -1048,18 +1047,17 @@ void SAL_CALL ValueItemAcc::removeAccessibleEventListener( const uno::Reference< if( rxListener.is() ) { - ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin(); - sal_Bool bFound = sal_False; + ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aEnd = mxEventListeners.end(); - while( !bFound && ( aIter != mxEventListeners.end() ) ) + for(::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin(); + aIter != aEnd; + ++aIter) { if( *aIter == rxListener ) { - mxEventListeners.erase( aIter ); - bFound = sal_True; + mxEventListeners.erase(aIter); + break; } - else - ++aIter; } } } |