[Libreoffice-commits] .: filter/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Tue Jun 21 16:39:51 PDT 2011


 filter/source/msfilter/escherex.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit abec38e49fa969ed0c107761cebe42694fb89a79
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jun 22 01:33:31 2011 +0200

    don't erase an entry in a vector and continue using the iterator

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index f87b18c..f6b2c14 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;


More information about the Libreoffice-commits mailing list