Suspicious loop: any idea?
Michael Stahl
mstahl at redhat.com
Mon Aug 18 03:37:51 PDT 2014
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.
More information about the LibreOffice
mailing list