Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Would this patch better ? (I kept the for loop)
diff --git a/sw/source/core/fields/cellfml.cxx
b/sw/source/core/fields/cellfml.cxx
index 33b953e..5c626dd 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -967,8 +967,8 @@ void SwTableFormula::GetBoxes( const SwTableBox&
rSttBox,
 
                 if( pTbl->IsHeadline( *pLine ) )
                 {
-                    rBoxes.erase( it++ );
-                    --it;
+                    SwSelBoxes::iterator toErase = it;
+                    rBoxes.erase( toErase );
                 }
             }
         } while( sal_False );

I read that to erase a position on a iterator invalidate this iterator from
position to the end
(http://www.cplusplus.com/reference/stl/vector/erase/)
I don't know if to create this temporary variable "toErase" change something
or it's all the same.

Moreover, I don't know if the evolution of the standard had changed the
behavior on this point.

Any idea ?

Julien
(sorry for the nitpicking but I'd like to understand this point)

--
View this message in context: 
http://nabble.documentfoundation.org/Question-about-iterator-management-in-sw-source-core-fields-cellfml-cxx-tp3708331p3711039.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.