summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-03-29 06:38:53 +0100
committerJulien Nabet <serval2412@yahoo.fr>2013-03-29 06:38:53 +0100
commit8e890570515bd33137b0b17d870c31c6a224930a (patch)
tree9a8c540d96a48b9123d7c763645f3ab6c9882da2 /vcl
parenteed411835d41118e72a304026c0a7a208be009b6 (diff)
Prefer prefix ++/-- operators for non-primitive types
+ add some const_iterator for end iterator Change-Id: I1e01325e52b67f2f882ca1de33efa4935bbb4232
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/vclevent.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index ddd8c7083525..26bbb5eec7a5 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -54,27 +54,28 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
// Copy the list, because this can be destroyed when calling a Link...
std::list<Link> aCopy( m_aListeners );
std::list<Link>::iterator aIter( aCopy.begin() );
+ std::list<Link>::const_iterator aEnd( aCopy.end() );
if( pEvent->IsA( VclWindowEvent::StaticType() ) )
{
VclWindowEvent* pWinEvent = static_cast<VclWindowEvent*>(pEvent);
ImplDelData aDel( pWinEvent->GetWindow() );
- while ( aIter != aCopy.end() && ! aDel.IsDead() )
+ while ( aIter != aEnd && ! aDel.IsDead() )
{
Link &rLink = *aIter;
// check this hasn't been removed in some re-enterancy scenario fdo#47368
if( std::find(m_aListeners.begin(), m_aListeners.end(), rLink) != m_aListeners.end() )
rLink.Call( pEvent );
- aIter++;
+ ++aIter;
}
}
else
{
- while ( aIter != aCopy.end() )
+ while ( aIter != aEnd )
{
Link &rLink = *aIter;
if( std::find(m_aListeners.begin(), m_aListeners.end(), rLink) != m_aListeners.end() )
rLink.Call( pEvent );
- aIter++;
+ ++aIter;
}
}
}
@@ -88,14 +89,15 @@ sal_Bool VclEventListeners::Process( VclSimpleEvent* pEvent ) const
// Copy the list, because this can be destroyed when calling a Link...
std::list<Link> aCopy( m_aListeners );
std::list<Link>::iterator aIter( aCopy.begin() );
- while ( aIter != aCopy.end() )
+ std::list<Link>::const_iterator aEnd( aCopy.end() );
+ while ( aIter != aEnd )
{
if( (*aIter).Call( pEvent ) != 0 )
{
bProcessed = sal_True;
break;
}
- aIter++;
+ ++aIter;
}
return bProcessed;
}