On Wed, Mar 19, 2003 at 05:23:17PM +0100, Andre Poenitz wrote:

> My bibkey breaking...

I'm going to stop now, btw. I hacked out the direct updates (below)
and it breaks everything so badly that there is no point attempting
(ever) cleaning this up.

john


Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.347
diff -u -p -r1.347 BufferView_pimpl.C
--- BufferView_pimpl.C  19 Mar 2003 14:45:04 -0000      1.347
+++ BufferView_pimpl.C  19 Mar 2003 16:30:11 -0000
@@ -499,9 +499,64 @@ void BufferView::Pimpl::workAreaResize()
 }
 
 
+void BufferView::Pimpl::updateInset(Inset * inset)
+{
+       if (!inset || !available()) {
+               lyxerr << "calling updateInset(), no inset" << endl;
+               return;
+       }
+
+       lyxerr << "calling updateInset()" << endl;
+
+       // first check for locking insets
+       if (bv_->theLockingInset()) {
+               if (bv_->theLockingInset() == inset) {
+                       if (bv_->text->updateInset(inset)) {
+                               lyxerr << "Calling update() within" << endl;
+                               //update();
+                               updateScrollbar();
+                               return;
+                       }
+               } else if (bv_->theLockingInset()->updateInsetInInset(bv_, inset)) {
+                       if (bv_->text->updateInset(bv_->theLockingInset())) {
+                               lyxerr << "Calling update() within 2" << endl;
+                               //update();
+                               updateScrollbar();
+                               return;
+                       }
+               }
+       }
+
+       // then check if the inset is a top_level inset (has no owner)
+       // if yes do the update as always otherwise we have to update the
+       // toplevel inset where this inset is inside
+       Inset * tl_inset = inset;
+       while (tl_inset->owner())
+               tl_inset = tl_inset->owner();
+       hideCursor();
+       if (tl_inset == inset) {
+               update(BufferView::UPDATE);
+               if (bv_->text->updateInset(inset)) {
+                       update(BufferView::SELECT);
+                       return;
+               }
+       } else if (static_cast<UpdatableInset *>(tl_inset)
+                          ->updateInsetInInset(bv_, inset))
+       {
+               if (bv_->text->updateInset(tl_inset)) {
+                       lyxerr << "Calling update() within 3" << endl;
+               //      update();
+                       updateScrollbar();
+               }
+       }
+}
+
+
 void BufferView::Pimpl::update()
 {
+       lyxerr << "calling update()" << endl;
        if (!bv_->theLockingInset() || !bv_->theLockingInset()->nodraw()) {
+       lyxerr << "actually doing update()" << endl;
                screen().update(*bv_);
                bool fitc = false;
                while (bv_->text->status() == LyXText::CHANGED_IN_DRAW) {
@@ -539,12 +594,14 @@ void BufferView::Pimpl::update(LyXText *
 
        text->fullRebreak();
 
+#if 0
        if (text->inset_owner) {
                text->inset_owner->setUpdateStatus(bv_, InsetText::NONE);
                updateInset(text->inset_owner);
        } else {
                update();
        }
+#endif
 }
 
 
@@ -558,12 +615,14 @@ void BufferView::Pimpl::update(BufferVie
 
        text->fullRebreak();
 
+#if 0
        if (text->inset_owner) {
                text->inset_owner->setUpdateStatus(bv_, InsetText::NONE);
                updateInset(text->inset_owner);
        } else {
                update();
        }
+#endif
 }
 
 
@@ -942,6 +1001,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
        // Make sure that the cached BufferView is correct.
        FuncRequest ev = ev_in;
        ev.setView(bv_);
+       bool ret = true;
 
        lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch:"
                << " action[" << ev.action << ']'
@@ -1270,10 +1330,10 @@ bool BufferView::Pimpl::dispatch(FuncReq
                break;
 
        default:
-               return bv_->getLyXText()->dispatch(FuncRequest(ev, bv_));
+               ret = bv_->getLyXText()->dispatch(FuncRequest(ev, bv_));
        } // end of switch
 
-       return true;
+       return ret;
 }
 
 
@@ -1335,50 +1395,4 @@ bool BufferView::Pimpl::insertInset(Inse
 
        unFreezeUndo();
        return true;
-}
-
-
-void BufferView::Pimpl::updateInset(Inset * inset)
-{
-       if (!inset || !available())
-               return;
-
-       // first check for locking insets
-       if (bv_->theLockingInset()) {
-               if (bv_->theLockingInset() == inset) {
-                       if (bv_->text->updateInset(inset)) {
-                               update();
-                               updateScrollbar();
-                               return;
-                       }
-               } else if (bv_->theLockingInset()->updateInsetInInset(bv_, inset)) {
-                       if (bv_->text->updateInset(bv_->theLockingInset())) {
-                               update();
-                               updateScrollbar();
-                               return;
-                       }
-               }
-       }
-
-       // then check if the inset is a top_level inset (has no owner)
-       // if yes do the update as always otherwise we have to update the
-       // toplevel inset where this inset is inside
-       Inset * tl_inset = inset;
-       while (tl_inset->owner())
-               tl_inset = tl_inset->owner();
-       hideCursor();
-       if (tl_inset == inset) {
-               update(BufferView::UPDATE);
-               if (bv_->text->updateInset(inset)) {
-                       update(BufferView::SELECT);
-                       return;
-               }
-       } else if (static_cast<UpdatableInset *>(tl_inset)
-                          ->updateInsetInInset(bv_, inset))
-       {
-               if (bv_->text->updateInset(tl_inset)) {
-                       update();
-                       updateScrollbar();
-               }
-       }
 }
Index: commandtags.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/commandtags.h,v
retrieving revision 1.117
diff -u -p -r1.117 commandtags.h
--- commandtags.h       13 Mar 2003 13:56:20 -0000      1.117
+++ commandtags.h       19 Mar 2003 16:30:12 -0000
@@ -147,7 +147,6 @@ enum kb_action {
        LFUN_MATH_MUTATE,               // Andre' 20010523
        LFUN_MATH_IMPORT_SELECTION,     // Andre' 20010704
        LFUN_MATH_SPACE,                // Andre' 20010725
-       LFUN_FIGURE,
        LFUN_DELETE_WORD_FORWARD,
        LFUN_DELETE_WORD_BACKWARD,
        LFUN_DELETE_LINE_FORWARD,
Index: lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.419
diff -u -p -r1.419 lyxfunc.C
--- lyxfunc.C   19 Mar 2003 14:45:09 -0000      1.419
+++ lyxfunc.C   19 Mar 2003 16:30:15 -0000
@@ -1577,15 +1577,34 @@ void LyXFunc::dispatch(FuncRequest const
                break;
        } // end of switch
 
-       view()->owner()->updateLayoutChoice();
-       view()->fitCursor();
-       
-       // If we executed a mutating lfun, mark the buffer as dirty
-       if (!lyxaction.funcHasFlag(ev.action, LyXAction::NoBuffer)
-           && !lyxaction.funcHasFlag(ev.action, LyXAction::ReadOnly))
-               view()->buffer()->markDirty();
        
 exit_with_message:
+
+       view()->owner()->updateLayoutChoice();
+
+       if (view()->available()) {
+               view()->fitCursor();
+       
+               // If we executed a mutating lfun, mark the buffer as dirty
+               if (!lyxaction.funcHasFlag(ev.action, LyXAction::NoBuffer)
+                   && !lyxaction.funcHasFlag(ev.action, LyXAction::ReadOnly))
+                       view()->buffer()->markDirty();
+
+               LyXText * lt = view()->getLyXText();
+
+               if (lt != view()->text) {
+                       lt->inset_owner->setUpdateStatus(view(), InsetText::NONE);
+                       view()->updateInset(lt->inset_owner);
+               }
+
+               lyxerr << "start of lfun update { " << endl;
+               if (view()->text->status() != LyXText::UNCHANGED)
+                       view()->update();
+               lyxerr << "} end of lfun update" << endl;
+
+       }
+
+
        sendDispatchMessage(getMessage(), ev, verbose);
 }
 
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.53
diff -u -p -r1.53 text3.C
--- text3.C     19 Mar 2003 15:04:23 -0000      1.53
+++ text3.C     19 Mar 2003 16:30:17 -0000
@@ -1393,7 +1393,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ
                bv->screen().toggleSelection(bv->text, bv);
                bv->text->clearSelection();
                bv->text->fullRebreak();
-               bv->update();
+       //      bv->update();
                bv->updateScrollbar();
 
                // Single left click in math inset?
Index: frontends/screen.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.C,v
retrieving revision 1.33
diff -u -p -r1.33 screen.C
--- frontends/screen.C  17 Mar 2003 16:24:57 -0000      1.33
+++ frontends/screen.C  19 Mar 2003 16:30:18 -0000
@@ -250,6 +250,7 @@ void LyXScreen::update(BufferView & bv, 
        int const vheight = workarea().workHeight();
        LyXText * text = bv.text;
 
+       lyxerr << "Starting paint" << endl;
        workarea().getPainter().start();
 
        switch (text->status()) {
@@ -275,6 +276,7 @@ void LyXScreen::update(BufferView & bv, 
        break;
        case LyXText::CHANGED_IN_DRAW: // just to remove the warning
        case LyXText::UNCHANGED:
+               lyxerr << "Doing nothing" << endl;
                // Nothing needs done
                break;
        }

Reply via email to