summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-08-27 07:09:15 +0200
committerJulien Nabet <serval2412@yahoo.fr>2013-08-27 07:09:15 +0200
commitfeb2604291c8b4710fd274307d50fba756cef277 (patch)
treef85df6f47eee8aa55c780321ecaabb4afae1e317 /svtools
parent6a419ad8f23f9c3964309de42fefb652e37c6697 (diff)
Replace for loop by std::advance + rename function parameter
Change-Id: I5d6615af2ed728be158edfe46b1c0fbadf7b3690
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/uno/unoimap.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 01e8b462e8c6..7071d86d5e77 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 );