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

julien2412 serval2412 at yahoo.fr
Wed Feb 1 14:40:07 PST 2012


Hi,

Cppcheck reports this :
core/sw/source/core/fields/cellfml.cxx
970	StlMissingComparison	style	Missing bounds check for extra iterator
increment in loop.

Here are the lines :
    961             // dann mal die Tabellenkoepfe raus:
    962             for( SwSelBoxes::iterator it = rBoxes.begin(); it !=
rBoxes.end(); ++it )
    963             {
    964                 pLine = it->second->GetUpper();
    965                 while( pLine->GetUpper() )
    966                     pLine = pLine->GetUpper()->GetUpper();
    967 
    968                 if( pTbl->IsHeadline( *pLine ) )
    969                 {
    970                     rBoxes.erase( it++ );
    971                     --it;
    972                 }
    973             }

Is it safe/ok ?

patch proposed
http://nabble.documentfoundation.org/file/n3708331/sw_patch.txt sw_patch.txt 

If ok, I can commit and push it on master.

Julien

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


More information about the LibreOffice mailing list