Hello Noel, all,

I have attached a test document and a diff. I don't understand why this
still crashs calc even if there is nothing anymore that can create any
problems.

How to reproduce:

open test document in calc
fix formula: =#NAME to =a
save with button in the toolbar

Regards,
Markus

Attachment: xlsx name import.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index f87b18c..5b80965 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3306,16 +3306,18 @@ 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;
         }
     }
+    if (it != maPersistTable.end())
+    {
+        delete *it;
+        maPersistTable.erase( it );
+    }
     return 0;
 }
 
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to