The most common operations (char insert, etc.) are calling
updateLayoutChoice at least twice. This moves it, making it only once
or no times.

We need it in scrollDocView() for cursor-follows-scrollbar benefit.

comments ?

john


Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.345
diff -u -p -r1.345 BufferView_pimpl.C
--- BufferView_pimpl.C  17 Mar 2003 16:24:48 -0000      1.345
+++ BufferView_pimpl.C  18 Mar 2003 18:59:17 -0000
@@ -379,6 +379,8 @@ void BufferView::Pimpl::scrollDocView(in
                vbt->setCursorFromCoordinates(0, first);
        else if (vbt->cursor.y() > last)
                vbt->setCursorFromCoordinates(0, last);
+
+       owner_->updateLayoutChoice();
 }
 
 
@@ -568,8 +570,6 @@ void BufferView::Pimpl::update()
 
 void BufferView::Pimpl::update(LyXText * text, BufferView::UpdateCodes f)
 {
-       owner_->updateLayoutChoice();
-
        if (!text->selection.set() && (f & SELECT)) {
                text->selection.cursor = text->cursor;
        }
Index: lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.417
diff -u -p -r1.417 lyxfunc.C
--- lyxfunc.C   17 Mar 2003 16:24:52 -0000      1.417
+++ lyxfunc.C   18 Mar 2003 18:59:32 -0000
@@ -1579,6 +1579,8 @@ void LyXFunc::dispatch(FuncRequest const
                break;
        } // end of switch
 
+       view()->owner()->updateLayoutChoice();
+       
 exit_with_message:
        sendDispatchMessage(getMessage(), ev, verbose);
 }
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.50
diff -u -p -r1.50 text3.C
--- text3.C     18 Mar 2003 13:05:08 -0000      1.50
+++ text3.C     18 Mar 2003 18:59:46 -0000
@@ -1408,7 +1408,6 @@ Inset::RESULT LyXText::dispatch(FuncRequ
                        // Highly editable inset, like math
                        UpdatableInset * inset = static_cast<UpdatableInset 
*>(inset_hit);
                        selection_possible = false;
-                       bv->owner()->updateLayoutChoice();
                        bv->owner()->message(inset->editMessage());
                        //inset->edit(bv, x, y, cmd.button());
                        // We just have to lock the inset before calling a PressEvent 
on it!
@@ -1433,7 +1432,6 @@ Inset::RESULT LyXText::dispatch(FuncRequ
                bv->text->selection.cursor = bv->text->cursor;
                bv->text->cursor.x_fix(bv->text->cursor.x());
 
-               bv->owner()->updateLayoutChoice();
                if (bv->fitCursor())
                        selection_possible = false;
 

Reply via email to