On Mon, Mar 24, 2003 at 06:07:21PM +0100, Alfredo Braunstein wrote:

> void LyXText::cursorEnd()
> {

Yes, manifests as a warning message in an empty par.

>         pos_type const pos_end = row->lastPos();
>         int labeladdon = 0;
>         int maxwidth = 0;
>         if (!row->par()->empty()) {
>         ^^^^^^^^^^^^^^^^^^^^^^^^^ eliminable casing

eliminable how ? with 0-N from lastPos() ?

>                 // Check if any insets are larger
>                 for (pos_type pos = row->pos(); pos <= pos_end; ++pos) {

> text.C (1075):
> 
>         // Check if any custom fonts are larger (Asger)
>         // This is not completely correct, but we can live with the small,
>         // cosmetic error for now.
>         LyXFont::FONT_SIZE maxsize =
>                 row->par()->highestFontInRange(row->pos(), pos_end, size);
> 
> not sure about this one... if the par has 1 char, pos_end gives 0. shouldn't
> this pos_end be pos_end + 1 (and then a casing is missing)? Or else we
> access an invalid position on highestFontInRange? I.e: is the range in
> highestFontInRange a 'char positions' range or a 'cursor positions' range?

I think it's char positions. We don't care about a font setting at the
very end, because there's as yet no text using that possibly larger
size. However, I bet things might break if it doesn't consider the font
at position 0 in an empty par. So it's actually right, I think ...

regards
john

Reply via email to