Suspicious loop: any idea?

Matteo Casalin matteo.casalin at yahoo.com
Sat Aug 16 13:42:46 PDT 2014


Hi all,
     function lcl_NotifyNeighbours in sw/source/core/frmedt/feshview.cxx 
has the following loop:

     for( size_t j = 0; j < pLst->GetMarkCount(); ++j )
     {
         [...]
         SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
         [...]
     }

I can't see any use of j inside the loop itself, and repeatedly calling 
"GetMark( 0 )" seems a little strange to me since I do not see any 
removal of the obtained Mark (which could explain the loop). I'm not 
familiar with this code, though: does anybody have an idea of whether 
the loop is correct or not, and in case of how to fix it?

Thanks!
Matteo


More information about the LibreOffice mailing list