On 10-Apr-2002 Lars Gullik Bjønnes wrote:

> I do not like it a lot sinced it introcues a iy() in lyxcursor. what
> is this iy really and why is it needed.
> 

Well you did read my comment on bug #44 in lyxbugs, didn't you? But I know
you're busy (as I am) so I explain it to you another time. Normally LyX put's
the cursor "before" the specified position (there is one exeption). In the
case of a NeedFullRow or displayed inset we want to set the cursor NOT in
front of the inset but at the end of the row before (if it is of the same
paragraph!), BUT we need the y position of the original position as otherwise
when we enter the inset we have a wrong outside y() and the insetcursor depends
on it, therefor for the inset we need the y position BEFORE the inset!
Explained well enough?

>| -    y -= (text.cursor.y());
>| +    y -= (text.cursor.iy());
> 
> feel free to remove the parantesis as well.

Sure

>| +    /// the y position if we put the cursor at the end of the upper row!
>| +    int iy_;
>
> I do not understand the comment.

Well it should say the y positon before the inset or something like that feel
free to give me a better short description for it.

> 
>| +    bool flag = true;
> 
> I hate variables just called flag, what is this a flag for? What does
> it mean?

Me too but it is really obvious for what it is needed and the function is
really short!

> should it really have been called
> "there_is_a_space_on_the_last_posisiton"?

no it should be

ignore_the_space_on_the_last_position

>| +    Inset * ins;
>| +    // we have to consider a space on the last position in this case!
>| +    if (row->next() && row->par() == row->next()->par() &&
>| +            row->next()->par()->getChar(last+1) == Paragraph::META_INSET &&
>| +            (ins=row->next()->par()->getInset(last+1)) &&
>| +            (ins->needFullRow() || ins->display()))
>| +    {
>| +            flag = false;
>| +    }
>|      if (last >= row->pos()
>|          && row->next()
>|          && row->next()->par() == row->par()
>| -        && row->par()->isSeparator(last))
>| +        && row->par()->isSeparator(last)
>| +            && flag)
>|              return last - 1;
>|      else
>|              return last;
> 
> If it fix the problem then ok... 

It fixes it but we have one more (but it is VERY unlikely someone discovered
it. It only happens if you have one or more full rows with ONLY chars
(no separators), try it and then try to press the "End" button and look where
the cursor goes ;)

But as I said it's very unlikely that someone sees this and it still puts the
inserted char in the right row, not like with the inset that it has the cursor
in the row below and inserts chars in the row above.

Well I commit it then!

           Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen Vigna        E-Mail:  [EMAIL PROTECTED]
Italienallee 13/N       Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen           Web:     http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Hlade's Law:
        If you have a difficult task, give it to a lazy person --
        they will find an easier way to do it.

Reply via email to