This rips out all the up&down 'deep update' stuff including
updateInsetInInset and most of BufferView::updateInset.

InsetText is now almost ok, only InsetTabular still has some
weird parts update-wise.

I am aware of a regression in the selection of the main text
(it always starts 1 "step" off, but somehow non-deterministically).
Should be fixable, though...

Andre'
 
-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)
Index: BufferView.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v
retrieving revision 1.176
diff -u -p -r1.176 BufferView.C
--- BufferView.C        4 Aug 2003 14:36:50 -0000       1.176
+++ BufferView.C        5 Aug 2003 07:44:59 -0000
@@ -552,9 +552,9 @@ int BufferView::unlockInset(UpdatableIns
 }
 
 
-void BufferView::updateInset(InsetOld * inset)
+void BufferView::updateInset()
 {
-       pimpl_->updateInset(inset);
+       pimpl_->updateInset();
 }
 
 
Index: BufferView.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.h,v
retrieving revision 1.137
diff -u -p -r1.137 BufferView.h
--- BufferView.h        4 Aug 2003 14:36:51 -0000       1.137
+++ BufferView.h        5 Aug 2003 07:44:59 -0000
@@ -75,7 +75,7 @@ public:
        /// perform pending painting updates
        void update();
        /// update for a particular inset
-       void updateInset(InsetOld * inset);
+       void updateInset();
        /// reset the scrollbar to reflect current view position
        void updateScrollbar();
        /// FIXME
Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.408
diff -u -p -r1.408 BufferView_pimpl.C
--- BufferView_pimpl.C  4 Aug 2003 09:06:29 -0000       1.408
+++ BufferView_pimpl.C  5 Aug 2003 07:44:59 -0000
@@ -1174,7 +1174,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
        case LFUN_INSET_INSERT: {
                InsetOld * inset = createInset(ev);
                if (inset && insertInset(inset)) {
-                       updateInset(inset);
+                       updateInset();
 
                        string const name = ev.getArg(0);
                        if (name == "bibitem") {
@@ -1370,46 +1370,13 @@ bool BufferView::Pimpl::insertInset(Inse
 }
 
 
-void BufferView::Pimpl::updateInset(InsetOld * inset)
+void BufferView::Pimpl::updateInset()
 {
-       if (!inset || !available())
+       if (!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
-       InsetOld * tl_inset = inset;
-       while (tl_inset->owner())
-               tl_inset = tl_inset->owner();
-       if (tl_inset == inset) {
-               update();
-               if (bv_->text->updateInset(inset)) {
-                       update();
-                       return;
-               }
-       } else if (static_cast<UpdatableInset *>(tl_inset)
-                          ->updateInsetInInset(bv_, inset))
-       {
-               if (bv_->text->updateInset(tl_inset)) {
-                       update();
-                       updateScrollbar();
-               }
-       }
+       // this should not be needed, but it is...
+       bv_->text->redoParagraph(bv_->text->cursor.par());
+       update();
+       updateScrollbar();
 }
Index: BufferView_pimpl.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.h,v
retrieving revision 1.97
diff -u -p -r1.97 BufferView_pimpl.h
--- BufferView_pimpl.h  4 Aug 2003 09:06:29 -0000       1.97
+++ BufferView_pimpl.h  5 Aug 2003 07:44:59 -0000
@@ -95,7 +95,7 @@ struct BufferView::Pimpl : public boost:
        ///
        bool insertInset(InsetOld * inset, string const & lout = string());
        ///
-       void updateInset(InsetOld * inset);
+       void updateInset();
        /// a function should be executed from the workarea
        bool workAreaDispatch(FuncRequest const & ev);
        /// a function should be executed
Index: bufferview_funcs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferview_funcs.C,v
retrieving revision 1.88
diff -u -p -r1.88 bufferview_funcs.C
--- bufferview_funcs.C  4 Aug 2003 09:06:30 -0000       1.88
+++ bufferview_funcs.C  5 Aug 2003 07:44:59 -0000
@@ -221,11 +221,11 @@ void number(BufferView * bv)
 
 void lang(BufferView * bv, string const & l)
 {
-       LyXFont font(LyXFont::ALL_IGNORE);
        Language const * lang = languages.getLanguage(l);
        if (!lang)
                return;
 
+       LyXFont font(LyXFont::ALL_IGNORE);
        font.setLanguage(lang);
        toggleAndShow(bv, font);
 }
@@ -234,14 +234,14 @@ void lang(BufferView * bv, string const 
 bool changeDepth(BufferView * bv, LyXText * text, DEPTH_CHANGE type, bool test_only)
 {
        if (!bv->available() || !text)
-           return false;
+               return false;
 
        if (test_only)
                return text->changeDepth(type, true);
 
        bool const changed = text->changeDepth(type, false);
        if (text->inset_owner)
-               bv->updateInset((InsetOld *)text->inset_owner);
+               bv->updateInset();
        bv->update();
        return changed;
 }
Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.418
diff -u -p -r1.418 text2.C
--- text2.C     5 Aug 2003 06:30:42 -0000       1.418
+++ text2.C     5 Aug 2003 07:44:59 -0000
@@ -320,13 +320,12 @@ void LyXText::toggleInset()
        if (!isHighlyEditableInset(inset))
                recordUndo(bv(), Undo::ATOMIC);
 
-       if (inset->isOpen()) {
+       if (inset->isOpen())
                inset->close(bv());
-       } else {
+       else
                inset->open(bv());
-       }
 
-       bv()->updateInset(inset);
+       bv()->updateInset();
 }
 
 
@@ -959,7 +958,7 @@ void LyXText::setParagraph(bool line_top
        setSelection();
        setCursor(tmpcursor.par(), tmpcursor.pos());
        if (inset_owner)
-               bv()->updateInset(inset_owner);
+               bv()->updateInset();
 }
 
 
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.102
diff -u -p -r1.102 text3.C
--- text3.C     4 Aug 2003 09:06:35 -0000       1.102
+++ text3.C     5 Aug 2003 07:45:00 -0000
@@ -70,7 +70,7 @@ namespace {
                if (selecting || lt->selection.mark()) {
                        lt->setSelection();
                        if (lt->isInInset())
-                               bv->updateInset(lt->inset_owner);
+                               bv->updateInset();
                }
                bv->update();
 
@@ -363,7 +363,7 @@ void specialChar(LyXText * lt, BufferVie
        if (!bv->insertInset(new_inset))
                delete new_inset;
        else
-               bv->updateInset(new_inset);
+               bv->updateInset();
 }
 
 
@@ -975,7 +975,7 @@ InsetOld::RESULT LyXText::dispatch(FuncR
                update();
                changeCase(LyXText::text_uppercase);
                if (inset_owner)
-                       bv->updateInset(inset_owner);
+                       bv->updateInset();
                update();
                break;
 
@@ -983,7 +983,7 @@ InsetOld::RESULT LyXText::dispatch(FuncR
                update();
                changeCase(LyXText::text_lowercase);
                if (inset_owner)
-                       bv->updateInset(inset_owner);
+                       bv->updateInset();
                update();
                break;
 
@@ -991,7 +991,7 @@ InsetOld::RESULT LyXText::dispatch(FuncR
                update();
                changeCase(LyXText::text_capitalization);
                if (inset_owner)
-                       bv->updateInset(inset_owner);
+                       bv->updateInset();
                update();
                break;
 
@@ -1001,7 +1001,7 @@ InsetOld::RESULT LyXText::dispatch(FuncR
                if (transposeChars(cursor))
                        checkParagraph(cursor.par(), cursor.pos());
                if (inset_owner)
-                       bv->updateInset(inset_owner);
+                       bv->updateInset();
                update();
                break;
 
Index: graphics/PreviewedInset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/PreviewedInset.C,v
retrieving revision 1.16
diff -u -p -r1.16 PreviewedInset.C
--- graphics/PreviewedInset.C   21 Jul 2003 21:30:56 -0000      1.16
+++ graphics/PreviewedInset.C   5 Aug 2003 07:45:00 -0000
@@ -125,7 +125,7 @@ void PreviewedInset::imageReady(PreviewI
        pimage_ = &pimage;
 
        if (view())
-               view()->updateInset(&inset_);
+               view()->updateInset();
 }
 
 } // namespace graphics
Index: insets/insetbibitem.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v
retrieving revision 1.22
diff -u -p -r1.22 insetbibitem.C
--- insets/insetbibitem.C       28 Jul 2003 23:53:36 -0000      1.22
+++ insets/insetbibitem.C       5 Aug 2003 07:45:00 -0000
@@ -40,8 +40,7 @@ InsetBibitem::InsetBibitem(InsetCommandP
 
 InsetBibitem::~InsetBibitem()
 {
-       InsetCommandMailer mailer("bibitem", *this);
-       mailer.hideDialog();
+       InsetCommandMailer("bibitem", *this).hideDialog();
 }
 
 
@@ -67,7 +66,7 @@ dispatch_result InsetBibitem::localDispa
                if (p.getCmdName().empty())
                        return DISPATCHED;
                setParams(p);
-               cmd.view()->updateInset(this);
+               cmd.view()->updateInset();
                cmd.view()->fitCursor();
                return DISPATCHED;
        }
Index: insets/insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.162
diff -u -p -r1.162 insetcollapsable.C
--- insets/insetcollapsable.C   4 Aug 2003 15:59:01 -0000       1.162
+++ insets/insetcollapsable.C   5 Aug 2003 07:45:00 -0000
@@ -210,7 +210,7 @@ void InsetCollapsable::insetUnlock(Buffe
        inset.insetUnlock(bv);
        if (scroll())
                scroll(bv, 0.0F);
-       bv->updateInset(this);
+       bv->updateInset();
 }
 
 
@@ -229,25 +229,22 @@ void InsetCollapsable::lfunMouseRelease(
 
        if (collapsed_ && cmd.button() != mouse_button::button3) {
                collapsed_ = false;
-               bv->updateInset(this);
+               bv->updateInset();
                bv->buffer()->markDirty();
                return;
        }
 
-       if (cmd.button() != mouse_button::button3 && hitButton(cmd))
-       {
+       if (cmd.button() != mouse_button::button3 && hitButton(cmd)) {
                if (collapsed_) {
                        collapsed_ = false;
-                       bv->updateInset(this);
-                       bv->buffer()->markDirty();
                } else {
                        collapsed_ = true;
                        bv->unlockInset(this);
-                       bv->updateInset(this);
-                       bv->buffer()->markDirty();
                }
-       } else if (!collapsed_ && (cmd.y > button_dim.y2)) {
-               ret = (inset.localDispatch(adjustCommand(cmd)) == DISPATCHED);
+               bv->updateInset();
+               bv->buffer()->markDirty();
+       } else if (!collapsed_ && cmd.y > button_dim.y2) {
+               ret = inset.localDispatch(adjustCommand(cmd)) == DISPATCHED;
        }
        if (cmd.button() == mouse_button::button3 && !ret)
                showInsetDialog(bv);
@@ -298,7 +295,7 @@ InsetOld::RESULT InsetCollapsable::local
                                        lyxerr << "branch collapsed_" << endl;
                                        collapsed_ = false;
                                        if (bv->lockInset(this)) {
-                                               bv->updateInset(this);
+                                               bv->updateInset();
                                                bv->buffer()->markDirty();
                                                inset.localDispatch(cmd);
                                                first_after_edit = true;
@@ -326,7 +323,7 @@ InsetOld::RESULT InsetCollapsable::local
                                first_after_edit = true;
                                if (!bv->lockInset(this))
                                        return DISPATCHED;
-                               bv->updateInset(this);
+                               bv->updateInset();
                                bv->buffer()->markDirty();
                                inset.localDispatch(cmd);
                        } else {
@@ -386,14 +383,6 @@ bool InsetCollapsable::unlockInsetInInse
 }
 
 
-bool InsetCollapsable::updateInsetInInset(BufferView * bv, InsetOld *in)
-{
-       if (in == this)
-               return true;
-       return inset.updateInsetInInset(bv, in);
-}
-
-
 int InsetCollapsable::insetInInsetY() const
 {
        return inset.insetInInsetY() - (top_baseline - inset.y());
@@ -501,10 +490,11 @@ InsetOld * InsetCollapsable::getInsetFro
 
 void InsetCollapsable::open(BufferView * bv)
 {
-       if (!collapsed_) return;
+       if (!collapsed_)
+               return;
 
        collapsed_ = false;
-       bv->updateInset(this);
+       bv->updateInset();
 }
 
 
@@ -514,7 +504,7 @@ void InsetCollapsable::close(BufferView 
                return;
 
        collapsed_ = true;
-       bv->updateInset(const_cast<InsetCollapsable *>(this));
+       bv->updateInset();
 }
 
 
Index: insets/insetcollapsable.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.h,v
retrieving revision 1.116
diff -u -p -r1.116 insetcollapsable.h
--- insets/insetcollapsable.h   31 Jul 2003 10:48:50 -0000      1.116
+++ insets/insetcollapsable.h   5 Aug 2003 07:45:00 -0000
@@ -73,8 +73,6 @@ public:
        bool unlockInsetInInset(BufferView *, UpdatableInset *,
                                bool lr = false);
        ///
-       bool updateInsetInInset(BufferView *, InsetOld *);
-       ///
        int insetInInsetY() const;
        ///
        RESULT localDispatch(FuncRequest const &);
Index: insets/insetcommand.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.C,v
retrieving revision 1.80
diff -u -p -r1.80 insetcommand.C
--- insets/insetcommand.C       28 Jul 2003 23:53:36 -0000      1.80
+++ insets/insetcommand.C       5 Aug 2003 07:45:00 -0000
@@ -102,7 +102,7 @@ dispatch_result InsetCommand::localDispa
                        return UNDISPATCHED;
 
                setParams(p);
-               cmd.view()->updateInset(this);
+               cmd.view()->updateInset();
                return DISPATCHED;
        }
 
Index: insets/insetert.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v
retrieving revision 1.146
diff -u -p -r1.146 insetert.C
--- insets/insetert.C   4 Aug 2003 15:59:01 -0000       1.146
+++ insets/insetert.C   5 Aug 2003 07:45:00 -0000
@@ -454,7 +454,7 @@ InsetOld::RESULT InsetERT::localDispatch
                 * taken by the text).
                 */
                inset.getLyXText(cmd.view())->fullRebreak();
-               bv->updateInset(this);
+               bv->updateInset();
                result = DISPATCHED;
        }
        break;
@@ -598,7 +598,7 @@ void InsetERT::status(BufferView * bv, E
                        break;
                }
                if (bv) {
-                       bv->updateInset(const_cast<InsetERT *>(this));
+                       bv->updateInset();
                        bv->buffer()->markDirty();
                }
        }
Index: insets/insetexternal.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.C,v
retrieving revision 1.93
diff -u -p -r1.93 insetexternal.C
--- insets/insetexternal.C      29 Jul 2003 08:57:51 -0000      1.93
+++ insets/insetexternal.C      5 Aug 2003 07:45:00 -0000
@@ -127,7 +127,7 @@ void InsetExternal::statusChanged()
 {
        BufferView * bv = renderer_->view();
        if (bv)
-               bv->updateInset(this);
+               bv->updateInset();
 }
 
 
@@ -152,7 +152,7 @@ dispatch_result InsetExternal::localDisp
                InsetExternal::Params p;
                InsetExternalMailer::string2params(cmd.argument, *buffer, p);
                setParams(p, buffer);
-               cmd.view()->updateInset(this);
+               cmd.view()->updateInset();
                return DISPATCHED;
        }
 
Index: insets/insetfloat.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.C,v
retrieving revision 1.90
diff -u -p -r1.90 insetfloat.C
--- insets/insetfloat.C 27 Jul 2003 13:18:55 -0000      1.90
+++ insets/insetfloat.C 5 Aug 2003 07:45:00 -0000
@@ -162,9 +162,8 @@ InsetFloat::~InsetFloat()
 
 dispatch_result InsetFloat::localDispatch(FuncRequest const & cmd)
 {
-       InsetOld::RESULT result = UNDISPATCHED;
-
        switch (cmd.action) {
+
        case LFUN_INSET_MODIFY: {
                InsetFloatParams params;
                InsetFloatMailer::string2params(cmd.argument, params);
@@ -173,22 +172,18 @@ dispatch_result InsetFloat::localDispatc
                params_.wide      = params.wide;
 
                wide(params_.wide, cmd.view()->buffer()->params);
-               cmd.view()->updateInset(this);
-               result = DISPATCHED;
+               cmd.view()->updateInset();
+               return DISPATCHED;
        }
-       break;
 
        case LFUN_INSET_DIALOG_UPDATE: {
-               InsetFloatMailer mailer(*this);
-               mailer.updateDialog(cmd.view());
+               InsetFloatMailer(*this).updateDialog(cmd.view());
+               return DISPATCHED;
        }
-       break;
 
        default:
-               result = InsetCollapsable::localDispatch(cmd);
+               return InsetCollapsable::localDispatch(cmd);
        }
-
-       return result;
 }
 
 
@@ -197,14 +192,13 @@ void InsetFloatParams::write(ostream & o
        os << "Float " // getInsetName()
           << type << '\n';
 
-       if (!placement.empty()) {
+       if (!placement.empty())
                os << "placement " << placement << "\n";
-       }
-       if (wide) {
+
+       if (wide)
                os << "wide true\n";
-       } else {
+       else
                os << "wide false\n";
-       }
 }
 
 
Index: insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.196
diff -u -p -r1.196 insetgraphics.C
--- insets/insetgraphics.C      2 Aug 2003 11:30:26 -0000       1.196
+++ insets/insetgraphics.C      5 Aug 2003 07:45:00 -0000
@@ -169,7 +169,7 @@ void InsetGraphics::statusChanged()
 {
        BufferView * bv = graphic_->view();
        if (bv)
-               bv->updateInset(this);
+               bv->updateInset();
 }
 
 
@@ -182,7 +182,7 @@ dispatch_result InsetGraphics::localDisp
                InsetGraphicsMailer::string2params(cmd.argument, buffer, p);
                if (!p.filename.empty()) {
                        setParams(p);
-                       cmd.view()->updateInset(this);
+                       cmd.view()->updateInset();
                }
                return DISPATCHED;
        }
Index: insets/insetinclude.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v
retrieving revision 1.133
diff -u -p -r1.133 insetinclude.C
--- insets/insetinclude.C       26 Jul 2003 21:37:10 -0000      1.133
+++ insets/insetinclude.C       5 Aug 2003 07:45:00 -0000
@@ -138,7 +138,7 @@ dispatch_result InsetInclude::localDispa
                if (!p.cparams.getCmdName().empty()) {
                        set(p);
                        params_.masterFilename_ = cmd.view()->buffer()->fileName();
-                       cmd.view()->updateInset(this);
+                       cmd.view()->updateInset();
                }
                return DISPATCHED;
        }
@@ -601,7 +601,7 @@ void InsetInclude::PreviewImpl::restartL
        lyxerr << "restartLoading()" << std::endl;
        removePreview();
        if (view())
-               view()->updateInset(&parent());
+               view()->updateInset();
        generatePreview();
 }
 
Index: insets/insetlabel.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlabel.C,v
retrieving revision 1.65
diff -u -p -r1.65 insetlabel.C
--- insets/insetlabel.C 25 Jul 2003 21:20:20 -0000      1.65
+++ insets/insetlabel.C 5 Aug 2003 07:45:00 -0000
@@ -59,7 +59,7 @@ dispatch_result InsetLabel::localDispatc
 
        case LFUN_INSET_EDIT:
                InsetCommandMailer("label", *this).showDialog(cmd.view());
-               result = DISPATCHED;
+               return DISPATCHED;
                break;
 
        case LFUN_INSET_MODIFY: {
@@ -75,16 +75,13 @@ dispatch_result InsetLabel::localDispatc
                }
 
                setParams(p);
-               cmd.view()->updateInset(this);
-               result = DISPATCHED;
+               cmd.view()->updateInset();
+               return DISPATCHED;
        }
-       break;
 
        default:
-               result = InsetCommand::localDispatch(cmd);
+               return InsetCommand::localDispatch(cmd);
        }
-
-       return result;
 }
 
 
Index: insets/insetminipage.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.85
diff -u -p -r1.85 insetminipage.C
--- insets/insetminipage.C      25 Jul 2003 21:20:20 -0000      1.85
+++ insets/insetminipage.C      5 Aug 2003 07:45:00 -0000
@@ -103,8 +103,7 @@ auto_ptr<InsetBase> InsetMinipage::clone
 
 InsetMinipage::~InsetMinipage()
 {
-       InsetMinipageMailer mailer(*this);
-       mailer.hideDialog();
+       InsetMinipageMailer(*this).hideDialog();
 }
 
 
@@ -121,7 +120,7 @@ dispatch_result InsetMinipage::localDisp
                /* FIXME: I refuse to believe we have to live
                 * with ugliness like this ... */
                inset.getLyXText(cmd.view())->fullRebreak();
-               cmd.view()->updateInset(this);
+               cmd.view()->updateInset();
                return DISPATCHED;
        }
 
Index: insets/insetnote.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.C,v
retrieving revision 1.38
diff -u -p -r1.38 insetnote.C
--- insets/insetnote.C  1 Aug 2003 15:36:47 -0000       1.38
+++ insets/insetnote.C  5 Aug 2003 07:45:00 -0000
@@ -122,28 +122,32 @@ dispatch_result InsetNote::localDispatch
        BufferView * bv = cmd.view();
 
        switch (cmd.action) {
-       case LFUN_INSET_MODIFY:
-               {
+
+       case LFUN_INSET_MODIFY: {
                InsetNoteParams params;
                InsetNoteMailer::string2params(cmd.argument, params);
                params_.type = params.type;
                setButtonLabel();
-               bv->updateInset(this);
+               bv->updateInset();
                return DISPATCHED;
-               }
+       }
+
        case LFUN_INSET_EDIT:
-               if (cmd.button() != mouse_button::button3)
-                       return InsetCollapsable::localDispatch(cmd);
-               return UNDISPATCHED;
+               if (cmd.button() == mouse_button::button3)
+                       return UNDISPATCHED;
+               return InsetCollapsable::localDispatch(cmd);
+
        case LFUN_INSET_DIALOG_UPDATE:
                InsetNoteMailer("note", *this).updateDialog(bv);
                return DISPATCHED;
+
        case LFUN_MOUSE_RELEASE:
                if (cmd.button() == mouse_button::button3 && hitButton(cmd)) {
                        InsetNoteMailer("note", *this).showDialog(bv);
                        return DISPATCHED;
                }
                // fallthrough:
+
        default:
                return InsetCollapsable::localDispatch(cmd);
        }
Index: insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.323
diff -u -p -r1.323 insettabular.C
--- insets/insettabular.C       4 Aug 2003 09:42:03 -0000       1.323
+++ insets/insettabular.C       5 Aug 2003 07:45:00 -0000
@@ -436,7 +436,7 @@ void InsetTabular::updateLocal(BufferVie
                need_update = what;
        // Dirty Cast! (Lgb)
        if (need_update != NONE) {
-               bv->updateInset(const_cast<InsetTabular *>(this));
+               bv->updateInset();
                if (locked)
                        resetPos(bv);
        }
@@ -516,25 +516,6 @@ bool InsetTabular::unlockInsetInInset(Bu
 }
 
 
-bool InsetTabular::updateInsetInInset(BufferView * bv, InsetOld * inset)
-{
-       InsetOld * tl_inset = inset;
-       // look if this inset is really inside myself!
-       while (tl_inset->owner() && tl_inset->owner() != this)
-               tl_inset = tl_inset->owner();
-       // if we enter here it's not ower inset
-       if (!tl_inset->owner())
-               return false;
-       // we only have to do this if this is a subinset of our cells
-       if (tl_inset != inset) {
-               if (!static_cast<InsetText *>(tl_inset)->updateInsetInInset(bv, inset))
-                       return false;
-       }
-       updateLocal(bv, CELL);
-       return true;
-}
-
-
 int InsetTabular::insetInInsetY() const
 {
        if (!the_locking_inset)
@@ -592,16 +573,6 @@ void InsetTabular::lfunMousePress(FuncRe
        if (actrow != orow)
                updateLocal(bv, NONE);
        clearSelection();
-#if 0
-       if (cmd.button() == mouse_button::button3) {
-               if ((ocell != actcell) && the_locking_inset) {
-                       the_locking_inset->insetUnlock(bv);
-                       updateLocal(bv, CELL);
-                       the_locking_inset = 0;
-               }
-               return;
-       }
-#endif
 
        bool const inset_hit = insetHit(bv, cmd.x, cmd.y);
 
Index: insets/insettabular.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.h,v
retrieving revision 1.141
diff -u -p -r1.141 insettabular.h
--- insets/insettabular.h       31 Jul 2003 10:48:50 -0000      1.141
+++ insets/insettabular.h       5 Aug 2003 07:45:00 -0000
@@ -96,8 +96,6 @@ public:
        bool unlockInsetInInset(BufferView *, UpdatableInset *,
                                bool lr = false);
        ///
-       bool updateInsetInInset(BufferView *, InsetOld *);
-       ///
        int insetInInsetY() const;
        ///
        UpdatableInset * getLockingInset() const;
Index: insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.467
diff -u -p -r1.467 insettext.C
--- insets/insettext.C  4 Aug 2003 15:59:01 -0000       1.467
+++ insets/insettext.C  5 Aug 2003 07:45:00 -0000
@@ -368,8 +368,7 @@ void InsetText::drawFrame(Painter & pain
        frame_y = top_baseline - dim_.asc + ttoD2;
        frame_w = dim_.wid - TEXT_TO_INSET_OFFSET;
        frame_h = dim_.asc + dim_.des - TEXT_TO_INSET_OFFSET;
-       pain.rectangle(frame_x, frame_y, frame_w, frame_h,
-                      frame_color);
+       pain.rectangle(frame_x, frame_y, frame_w, frame_h, frame_color);
 }
 
 
@@ -389,7 +388,7 @@ void InsetText::updateLocal(BufferView *
        bv->fitCursor();
 
        if (flag)
-               bv->updateInset(const_cast<InsetText *>(this));
+               bv->updateInset();
 
        bv->owner()->view_state_changed();
        bv->owner()->updateMenubar();
@@ -544,44 +543,6 @@ bool InsetText::unlockInsetInInset(Buffe
                return true;
        }
        return the_locking_inset->unlockInsetInInset(bv, inset, lr);
-}
-
-
-bool InsetText::updateInsetInInset(BufferView * bv, InsetOld * inset)
-{
-       if (!autoBreakRows && paragraphs.size() > 1)
-               collapseParagraphs(bv);
-
-       if (inset == this)
-               return true;
-
-       if (inset->owner() != this) {
-               bool found = false;
-               UpdatableInset * tl_inset = the_locking_inset;
-               if (tl_inset)
-                       found = tl_inset->updateInsetInInset(bv, inset);
-               if (!found) {
-                       tl_inset = static_cast<UpdatableInset *>(inset);
-                       while(tl_inset->owner() && tl_inset->owner() != this)
-                               tl_inset = static_cast<UpdatableInset 
*>(tl_inset->owner());
-                       if (!tl_inset->owner())
-                               return false;
-                       found = tl_inset->updateInsetInInset(bv, inset);
-               } else {
-                       text_.updateInset(tl_inset);
-               }
-               return found;
-       }
-       bool found = text_.updateInset(inset);
-       if (found) {
-               if (the_locking_inset &&
-                   cpar() == inset_par && cpos() == inset_pos)
-               {
-                       inset_x = cix() - top_x + drawTextXOffset;
-                       inset_y = ciy() + drawTextYOffset;
-               }
-       }
-       return found;
 }
 
 
Index: insets/insettext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.h,v
retrieving revision 1.191
diff -u -p -r1.191 insettext.h
--- insets/insettext.h  4 Aug 2003 15:59:01 -0000       1.191
+++ insets/insettext.h  5 Aug 2003 07:45:00 -0000
@@ -84,8 +84,6 @@ public:
        bool unlockInsetInInset(BufferView *,
                                UpdatableInset *, bool lr = false);
        ///
-       bool updateInsetInInset(BufferView *, InsetOld *);
-       ///
        RESULT localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &,
Index: insets/insetwrap.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.C,v
retrieving revision 1.33
diff -u -p -r1.33 insetwrap.C
--- insets/insetwrap.C  27 Jul 2003 13:18:55 -0000      1.33
+++ insets/insetwrap.C  5 Aug 2003 07:45:00 -0000
@@ -91,7 +91,7 @@ dispatch_result InsetWrap::localDispatch
                params_.placement = params.placement;
                params_.width     = params.width;
 
-               cmd.view()->updateInset(this);
+               cmd.view()->updateInset();
                return DISPATCHED;
        }
 
@@ -107,12 +107,11 @@ dispatch_result InsetWrap::localDispatch
 
 void InsetWrapParams::write(ostream & os) const
 {
-       os << "Wrap " // getInsetName()
-          << type << '\n';
+       os << "Wrap " << type << '\n';
 
-       if (!placement.empty()) {
+       if (!placement.empty())
                os << "placement " << placement << "\n";
-       }
+
        os << "width \"" << width.asString() << "\"\n";
 }
 
Index: insets/updatableinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/updatableinset.C,v
retrieving revision 1.18
diff -u -p -r1.18 updatableinset.C
--- insets/updatableinset.C     31 Jul 2003 10:48:50 -0000      1.18
+++ insets/updatableinset.C     5 Aug 2003 07:45:00 -0000
@@ -125,7 +125,7 @@ InsetOld::RESULT UpdatableInset::localDi
                        int const xx = strToInt(ev.argument);
                        scroll(ev.view(), xx);
                }
-               ev.view()->updateInset(this);
+               ev.view()->updateInset();
 
                return DISPATCHED;
        }
Index: insets/updatableinset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/updatableinset.h,v
retrieving revision 1.12
diff -u -p -r1.12 updatableinset.h
--- insets/updatableinset.h     31 Jul 2003 10:48:50 -0000      1.12
+++ insets/updatableinset.h     5 Aug 2003 07:45:00 -0000
@@ -78,9 +78,6 @@ public:
        ///
        virtual int insetInInsetY() const { return 0; }
        ///
-       virtual bool updateInsetInInset(BufferView *, InsetOld *)
-               { return false; }
-       ///
        virtual bool lockInsetInInset(BufferView *, UpdatableInset *)
                { return false; }
        ///
Index: mathed/formulabase.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.278
diff -u -p -r1.278 formulabase.C
--- mathed/formulabase.C        2 Aug 2003 11:30:29 -0000       1.278
+++ mathed/formulabase.C        5 Aug 2003 07:45:00 -0000
@@ -156,12 +156,12 @@ void InsetFormulaBase::insetUnlock(Buffe
        if (mathcursor) {
                if (mathcursor->inMacroMode()) {
                        mathcursor->macroModeClose();
-                       bv->updateInset(this);
+                       bv->updateInset();
                }
                releaseMathCursor(bv);
        }
        generatePreview();
-       bv->updateInset(this);
+       bv->updateInset();
 }
 
 
@@ -207,7 +207,7 @@ void InsetFormulaBase::fitInsetCursor(Bu
 void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
 {
        if (mathcursor)
-               bv->updateInset(this);
+               bv->updateInset();
 }
 
 
@@ -217,7 +217,7 @@ dispatch_result InsetFormulaBase::lfunMo
                return UNDISPATCHED;
 
        BufferView * bv = cmd.view();
-       bv->updateInset(this);
+       bv->updateInset();
        //lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl;
 
        if (cmd.button() == mouse_button::button3) {
@@ -236,7 +236,7 @@ dispatch_result InsetFormulaBase::lfunMo
                mathcursor->selClear();
                mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
                mathcursor->insert(ar);
-               bv->updateInset(this);
+               bv->updateInset();
                return DISPATCHED;
        }
 
@@ -283,7 +283,7 @@ dispatch_result InsetFormulaBase::lfunMo
                return DISPATCHED;
        }
 
-       bv->updateInset(this);
+       bv->updateInset();
        return DISPATCHED;
 }
 
@@ -311,7 +311,7 @@ dispatch_result InsetFormulaBase::lfunMo
 
        BufferView * bv = cmd.view();
        mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
-       bv->updateInset(this);
+       bv->updateInset();
        return DISPATCHED;
 }
 
@@ -345,7 +345,7 @@ dispatch_result InsetFormulaBase::localD
                        }
                        // if that is removed, we won't get the magenta box when 
entering an
                        // inset for the first time
-                       bv->updateInset(this);
+                       bv->updateInset();
                        return DISPATCHED;
 
                case LFUN_MOUSE_PRESS:
@@ -723,7 +723,7 @@ dispatch_result InsetFormulaBase::localD
        }
 
        if (result == DISPATCHED)
-               bv->updateInset(this);
+               bv->updateInset();
 
        mathcursor->normalize();
        mathcursor->touch();
@@ -853,7 +853,7 @@ bool InsetFormulaBase::searchForward(Buf
                        mathcursor->setSelection(it, ar.size());
                        current = it;
                        it.jump(ar.size());
-                       bv->updateInset(this);
+                       bv->updateInset();
                        return true;
                }
        }

Reply via email to