Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Stephan Bergmann
On 02/01/2012 11:40 PM, julien2412 wrote: Cppcheck reports this : core/sw/source/core/fields/cellfml.cxx 970 StlMissingComparisonstyle Missing bounds check for extra iterator increment in loop. Here are the lines : 961 // dann mal die Tabellenkoepfe raus: 962

Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Marcel Metz
Hello Julien On 02/01/2012 11:40 PM, julien2412 wrote: Here are the lines : 961 // dann mal die Tabellenkoepfe raus: 962 for( SwSelBoxes::iterator it = rBoxes.begin(); it != rBoxes.end(); ++it ) 963 { 964 pLine =

Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Lubos Lunak
On Thursday 02 of February 2012, Stephan Bergmann wrote: On 02/01/2012 11:40 PM, julien2412 wrote: Here are the lines : 961 // dann mal die Tabellenkoepfe raus: 962 for( SwSelBoxes::iterator it = rBoxes.begin(); it != rBoxes.end(); ++it ) 963

Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Stephan Bergmann
On 02/02/2012 10:13 AM, Marcel Metz wrote: If the box that is represented by `it` should be deleted you could use. 970 it = rBoxes.erase( it ); Unfortunately, this is only C++11, not C++03. Stephan ___ LibreOffice mailing list

Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Stephan Bergmann
On 02/02/2012 11:26 AM, Lubos Lunak wrote: I agree with all the points, but in Julien's defense, I remember exactly this same approach was pushed in recently as a fix to the same issue elsewhere. Might well be, I probably didn't notice. And this is in no way meant to criticize Julien --

Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Lubos Lunak
On Thursday 02 of February 2012, Stephan Bergmann wrote: On 02/02/2012 11:26 AM, Lubos Lunak wrote: I agree with all the points, but in Julien's defense, I remember exactly this same approach was pushed in recently as a fix to the same issue elsewhere. Might well be, I probably didn't

Re: [Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-02 Thread Stephan Bergmann
On 02/02/2012 02:06 PM, Lubos Lunak wrote: I definitely didn't mean to get formal here, I simply meant a description of how to actually handle this, as it turns up now and then, and STL doesn't make this trivial. In which case the answer should be to read Item 9 Choose carefully among

[Libreoffice] Question about iterator management in sw/source/core/fields/cellfml.cxx

2012-02-01 Thread julien2412
Hi, Cppcheck reports this : core/sw/source/core/fields/cellfml.cxx 970 StlMissingComparisonstyle Missing bounds check for extra iterator increment in loop. Here are the lines : 961 // dann mal die Tabellenkoepfe raus: 962 for( SwSelBoxes::iterator it =