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

Julien Nabet serval2412 at yahoo.fr
Mon Aug 26 22:09:45 PDT 2013


 svtools/source/uno/unoimap.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit feb2604291c8b4710fd274307d50fba756cef277
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Aug 27 07:09:15 2013 +0200

    Replace for loop by std::advance + rename function parameter
    
    Change-Id: I5d6615af2ed728be158edfe46b1c0fbadf7b3690

diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 01e8b46..7071d86 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -647,13 +647,13 @@ void SAL_CALL SvUnoImageMap::insertByIndex( sal_Int32 Index, const Any& Element
     }
 }
 
-void SAL_CALL SvUnoImageMap::removeByIndex( sal_Int32 Index ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
+void SAL_CALL SvUnoImageMap::removeByIndex( sal_Int32 nIndex ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
 {
     const sal_Int32 nCount = maObjectList.size();
-    if( Index >= nCount )
+    if( nIndex >= nCount )
         throw IndexOutOfBoundsException();
 
-    if( nCount - 1 == Index )
+    if( nCount - 1 == nIndex )
     {
         maObjectList.back()->release();
         maObjectList.pop_back();
@@ -661,8 +661,7 @@ void SAL_CALL SvUnoImageMap::removeByIndex( sal_Int32 Index ) throw(IndexOutOfBo
     else
     {
         std::list< SvUnoImageMapObject* >::iterator aIter = maObjectList.begin();
-        for( sal_Int32 n = 0; n < Index; n++ )
-            ++aIter;
+        std::advance(aIter, nIndex);
 
         (*aIter)->release();
         maObjectList.erase( aIter );


More information about the Libreoffice-commits mailing list