[Libreoffice-commits] core.git: svtools/source
Julien Nabet
serval2412 at yahoo.fr
Mon Aug 26 22:19:30 PDT 2013
svtools/source/control/toolbarmenuacc.cxx | 24 +++++++++++-------------
svtools/source/control/valueacc.cxx | 26 ++++++++++++--------------
2 files changed, 23 insertions(+), 27 deletions(-)
New commits:
commit 6ce6d0a41817c3eb9ec857c478c31594f0673735
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue Aug 27 07:18:56 2013 +0200
Bin bool + transform while into for loop + add end iterator (3)
Change-Id: I3d22eede61fb7ba15bac6f6130a7a60ec62170dc
diff --git a/svtools/source/control/toolbarmenuacc.cxx b/svtools/source/control/toolbarmenuacc.cxx
index 8c35f91..1ad9cbf 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 985f9fb..e92b7ca 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;
}
}
}
More information about the Libreoffice-commits
mailing list