Bin intermediate iterator + rename parameter function

(see example of http://www.cplusplus.com/reference/vector/vector/erase/)

Change-Id: I8c0ee334abd91ea99b80a43581a04cbbf9a91fa3
This commit is contained in:
Julien Nabet
2013-08-27 06:09:45 +02:00
parent 1b1f49f5d6
commit c6040d9bd4

View File

@@ -109,16 +109,14 @@ void SAL_CALL PropertySetContainer::insertByIndex( sal_Int32 Index, const ::com:
throw IndexOutOfBoundsException( OUString(), (OWeakObject *)this ); throw IndexOutOfBoundsException( OUString(), (OWeakObject *)this );
} }
void SAL_CALL PropertySetContainer::removeByIndex( sal_Int32 Index ) void SAL_CALL PropertySetContainer::removeByIndex( sal_Int32 nIndex )
throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException ) throw ( IndexOutOfBoundsException, WrappedTargetException, RuntimeException )
{ {
ResetableGuard aGuard( m_aLock ); ResetableGuard aGuard( m_aLock );
if ( (sal_Int32)m_aPropertySetVector.size() > Index ) if ( (sal_Int32)m_aPropertySetVector.size() > nIndex )
{ {
PropertySetVector::iterator aIter = m_aPropertySetVector.begin(); m_aPropertySetVector.erase(m_aPropertySetVector.begin() + nIndex);
aIter += Index;
m_aPropertySetVector.erase( aIter );
} }
else else
throw IndexOutOfBoundsException( OUString(), (OWeakObject *)this ); throw IndexOutOfBoundsException( OUString(), (OWeakObject *)this );