Suspicious loop: any idea?

Matteo Casalin matteo.casalin at yahoo.com
Mon Aug 18 11:29:40 PDT 2014


Hi Michael, all

On 08/18/2014 12:37 PM, Michael Stahl wrote:
> On 16/08/14 22:42, Matteo Casalin wrote:
>> 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?
>
> i think you're right, it's very suspicious and the 0 should be replaced
> by j.  probably the feature is obscure enough that it doesn't cause
> easily noticeable problems; you have to select more than 1 fly and then
> invoke some send-to-top or send-to-bottom feature.
>
>

Pushed replacement of 0 with j as

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5d5c102e36bcc7eac6ae89d44a635e5d9b680e40

Thanks everybody for your comments
Matteo

>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>



More information about the LibreOffice mailing list