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'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to