[Libreoffice-commits] core.git: vcl/source

Julien Nabet serval2412 at yahoo.fr
Thu Mar 28 22:41:49 PDT 2013


 vcl/source/app/vclevent.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 8e890570515bd33137b0b17d870c31c6a224930a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Fri Mar 29 06:38:53 2013 +0100

    Prefer prefix ++/-- operators for non-primitive types
    
    + add some const_iterator for end iterator
    
    Change-Id: I1e01325e52b67f2f882ca1de33efa4935bbb4232

diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index ddd8c70..26bbb5e 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;
 }


More information about the Libreoffice-commits mailing list