On 13-Nov-2001 Andre Poenitz wrote:
> On Tue, Nov 13, 2001 at 11:02:01AM +0100, Juergen Vigna wrote:
>> You call unlockInset(FINISHED_RIGHT) or unlockInset(FINISHED_LEFT) and
>> then the BufferView::unlockInset(where) call has to see where the inset
>> is in and how to handle RIGHT and LEFT!
> 
> Ok. Than this is fine. And this handles the "undispatched" space too?

Well I guess so and by the same time the really ugly returncode handling
of the LocalDispatch() functions can be cleaned up!

What's effectively the difference between the calls now? Other then moving
the cursor around, the only difference between DISPATCHED(_NOUPDATE) and
FINISHED* is, that on a FINISHED we do a owner->showState().

As we would care to move the cursor in the unlockInset(where) call we now
would have something like this:

...
   } else if (((result=owner->view()->theLockingInset()->
                localDispatch(owner->view(), action, argument)) ==
                   UpdatableInset::DISPATCHED) ||
                   (result == UpdatableInset::DISPATCHED_NOUPDATE))
   {
       return string();
    } else if (result == UpdatableInset::FINISHED) {
       owner->showState();
       return string();
    }
... // go on for UNDISPATCHED RESULTS

We have also this else only part for UNDISPATCHED results actually in the
if then elif else endif above:

...
        } else {
                //setMessage(N_("Text mode"));
                switch (action) {
                case LFUN_UNKNOWN_ACTION:
                case LFUN_BREAKPARAGRAPH:
                case LFUN_BREAKLINE:
                        TEXT()->cursorRight(owner->view());
                        owner->view()->setState();
                        owner->showState();
                        break;
                case LFUN_RIGHT:
                        if
(!TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
                                TEXT()->cursorRight(owner->view());
                                moveCursorUpdate(true, false);
                                owner->showState();
                        }
                        return string();
                case LFUN_LEFT: 
                        if
(TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
                                TEXT()->cursorRight(owner->view());
                                moveCursorUpdate(true, false);
                                owner->showState();
                        }
                        return string();
                case LFUN_DOWN:
                        if (TEXT()->cursor.row()->next())
                                TEXT()->cursorDown(owner->view());
                        else
                                TEXT()->cursorRight(owner->view());
                        moveCursorUpdate(true, false);
                        owner->showState();
                        return string();
                default:
                        break;
                }
        }
...

But I think this is plainly wrong! Why the hell should we move the cursor
DOWN on a locked inset? So this should be removed anyway!

Hope this clears some stuff!

         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
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

The Angels want to wear my red shoes.
                -- E. Costello

Reply via email to