diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-06-22 01:33:31 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-06-22 01:37:13 +0200 |
commit | 5e137eb78c8a49508f105af6d32355e739140308 (patch) | |
tree | 8764421315698738646231d3fec911c8a07ba7e4 /filter | |
parent | Be gracious with broken paths (diff) | |
download | core-5e137eb78c8a49508f105af6d32355e739140308.tar.gz core-5e137eb78c8a49508f105af6d32355e739140308.zip |
don't erase an entry in a vector and continue using the iterator
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 998a1537d993..2bd758eb91c6 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -3306,14 +3306,13 @@ void EscherPersistTable::PtInsert( sal_uInt32 nID, sal_uInt32 nOfs ) sal_uInt32 EscherPersistTable::PtDelete( sal_uInt32 nID ) { - for( - EscherPersistTable_impl::iterator it = maPersistTable.begin(); - it < maPersistTable.end(); - ++it - ) { + EscherPersistTable_impl::iterator it = maPersistTable.begin(); + for( ; it != maPersistTable.end() ; ++it ) + { if ( (*it)->mnID == nID ) { delete *it; maPersistTable.erase( it ); + break; } } return 0; @@ -3324,7 +3323,7 @@ sal_uInt32 EscherPersistTable::PtGetOffsetByID( sal_uInt32 nID ) for( size_t i = 0, n = maPersistTable.size(); i < n; ++i ) { EscherPersistEntry* pPtr = maPersistTable[ i ]; if ( pPtr->mnID == nID ) { - return ((EscherPersistEntry*)pPtr)->mnOffset; + return pPtr->mnOffset; } } return 0; |