On Friday 12 July 2002 7:26 am, Andre Poenitz wrote:
> On Thu, Jul 11, 2002 at 07:04:03PM +0100, Angus Leeming wrote:
> >     // top_y is not const because it's reset by getRowNearY.
> >     int top_y = bv.text->first_y;
> >     Row const * row = bv.text->getRowNearY(top_y);
> >
> >     int const bv_height = bv.painter().paperHeight();
> >     int height = row->height();
> >     rows.push_back(row);
> >
> >     while (height < bv_height) {
> >             row = row->next();
> > +           if (!row)
> > +                   break;
> >             height += row->height();
> >             rows.push_back(row);
> >     }
> >
> >     return rows;
> > }
>
> What about writing this as
>
> for (int height = 0; row && height < bv_height; row = row->next()) {
>       height += row->height();
>       rows.push_back(row);
> }
>
> Andre'

Cheers André. I'lll think about it ;-)

Reply via email to