]> git.lyx.org Git - features.git/commitdiff
the update/updateInset merge
authorAndré Pönitz <poenitz@gmx.net>
Mon, 10 Nov 2003 13:23:14 +0000 (13:23 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 10 Nov 2003 13:23:14 +0000 (13:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8069 a592a061-630c-0410-9148-cb99ea01b6c8

28 files changed:
src/BufferView.C
src/BufferView.h
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/ChangeLog
src/bufferview_funcs.C
src/cursor.C
src/frontends/LyXView.C
src/insets/insetbibitem.C
src/insets/insetbox.C
src/insets/insetbranch.C
src/insets/insetcollapsable.C
src/insets/insetcommand.C
src/insets/insetert.C
src/insets/insetexternal.C
src/insets/insetfloat.C
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/insets/insetlabel.C
src/insets/insetminipage.C
src/insets/insetnote.C
src/insets/insettabular.C
src/insets/insettext.C
src/insets/insetwrap.C
src/insets/updatableinset.C
src/mathed/formulabase.C
src/text2.C
src/text3.C

index 747768eb149364c85eb5c98d8e68983754cbc913..af246c8a0b41d1e27c9d9692d6c15fc717f6a23b 100644 (file)
@@ -394,12 +394,6 @@ void BufferView::hideCursor()
 }
 
 
-void BufferView::updateInset(InsetOld const * inset)
-{
-       pimpl_->updateInset(inset);
-}
-
-
 bool BufferView::ChangeRefsIfUnique(string const & from, string const & to)
 {
        // Check if the label 'from' appears more than once
index d3ec1cb83351a6d304d8d27be12939a979897466..2865989f9be09f08f368b5f4b8cae08cecdffbe6 100644 (file)
@@ -86,19 +86,6 @@ public:
        bool fitCursor();
        /// perform pending painting updates
        void update();
-       /** update for a particular inset. Gets a pointer and not a
-        *  reference because we really need the pointer information
-        *  to find it in the buffer.
-   *
-        * Extracted from Matthias notes:
-        *
-        * If a inset wishes any redraw and/or update it just has to call
-        * updateInset(this). It's is completly irrelevant, where the inset is.
-   * UpdateInset will find it in any paragraph in any buffer.
-        * Of course the insets in the current paragraph/buffer
-        * are checked first, so no performance problem should occur.
-        */
-       void updateInset(InsetOld const *);
        /// reset the scrollbar to reflect current view position
        void updateScrollbar();
        /// FIXME
@@ -196,9 +183,9 @@ public:
        bool dispatch(FuncRequest const & argument);
        
        /// set target x position of cursor
-       void BufferView::x_target(int x);
+       void x_target(int x);
        /// return target x position of cursor
-       int BufferView::x_target() const;
+       int x_target() const;
 
        /// access to cursor
        LCursor & cursor();
index 53b8cbce7601b7e05acf602f26a02c70cb58ecac..d0213c2cbfb84a5c92736ed9a23e208c08ee1f12 100644 (file)
@@ -599,9 +599,17 @@ void BufferView::Pimpl::update()
 {
        //lyxerr << "BufferView::update()" << endl;
        // fix cursor coordinate cache in case something went wrong
+
+       // check needed to survive LyX startup
        if (bv_->getLyXText()) {
-               // check needed to survive LyX startup
                bv_->getLyXText()->redoCursor();
+
+               // update all 'visible' paragraphs
+               ParagraphList::iterator beg, end;
+               getVisiblePars(beg, end);
+               bv_->text->redoParagraphs(beg, end);
+
+               updateScrollbar();
        }
        screen().redraw(*bv_);
 }
@@ -938,7 +946,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd)
                        cmd2.y -= inset->y();
                        res = inset->dispatch(cmd2);
                        if (res.update())
-                               bv_->updateInset(inset);
+                               bv_->update();
                        res.update(false);
                }
 
@@ -1094,8 +1102,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                InsetBase * inset = owner_->getDialogs().getOpenInset(name);
                if (inset) {
                        // This works both for 'original' and 'mathed' insets.
-                       // Note that the localDispatch performs updateInset
-                       // also.
+                       // Note that the localDispatch performs update also.
                        FuncRequest fr(bv_, LFUN_INSET_MODIFY, ev.argument);
                        inset->dispatch(fr);
                } else {
@@ -1107,21 +1114,10 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
 
        case LFUN_INSET_INSERT: {
                InsetOld * inset = createInset(ev);
-               if (inset && insertInset(inset)) {
-                       updateInset(inset);
-
-                       string const name = ev.getArg(0);
-                       if (name == "bibitem") {
-                               // We need to do a redraw because the maximum
-                               // InsetBibitem width could have changed
-#warning check whether the update() is needed at all
-                               bv_->update();
-                       }
-               } else {
+               if (!inset || !insertInset(inset))
                        delete inset;
-               }
+               break;
        }
-       break;
 
        case LFUN_FLOAT_LIST:
                if (tclass.floats().typeExist(ev.argument)) {
@@ -1273,23 +1269,6 @@ bool BufferView::Pimpl::insertInset(InsetOld * inset, string const & lout)
 }
 
 
-void BufferView::Pimpl::updateInset(InsetOld const * /*inset*/)
-{
-       if (!available())
-               return;
-
-#warning used for asynchronous updates?
-       //bv_->text->redoParagraph(outerPar(*bv_->buffer(), inset));
-
-       // this should not be needed, but it is...
-       bv_->text->redoParagraph(bv_->text->cursorPar());
-       // bv_->text->fullRebreak();
-
-       update();
-       updateScrollbar();
-}
-
-
 bool BufferView::Pimpl::ChangeInsets(InsetOld::Code code,
                                     string const & from, string const & to)
 {
@@ -1347,3 +1326,22 @@ void BufferView::Pimpl::updateParagraphDialog()
        data = "update " + tostr(accept) + '\n' + data;
        bv_->owner()->getDialogs().update("paragraph", data);
 }
+
+
+void BufferView::Pimpl::getVisiblePars
+       (ParagraphList::iterator & beg, ParagraphList::iterator & end)
+{
+       beg = bv_->text->cursorPar();
+       end = beg;
+
+       for ( ; beg != bv_->text->ownerParagraphs().begin(); --beg)
+               if (beg->y - top_y() < 0)
+                       break;
+
+       if (beg != bv_->text->ownerParagraphs().begin())
+               --beg;
+
+       for ( ; end != bv_->text->ownerParagraphs().end(); ++end)
+               if (end->y - top_y() > workarea().workHeight())
+                       break;
+}
index 19e702bea2728c1191cc53c1d24fb1fdbbc1d16d..a7f06bce88f4bd1589159cb6d723ef068679d05c 100644 (file)
@@ -104,8 +104,6 @@ struct BufferView::Pimpl : public boost::signals::trackable {
        void center();
        ///
        bool insertInset(InsetOld * inset, std::string const & lout = std::string());
-       ///
-       void updateInset(InsetOld const * inset);
        /// a function should be executed from the workarea
        bool workAreaDispatch(FuncRequest const & ev);
        /// a function should be executed
@@ -195,6 +193,9 @@ private:
        void MenuInsertLyXFile(std::string const & filen);
        /// our workarea
        WorkArea & workarea() const;
+       /// range of visible main text paragraphs
+       void getVisiblePars(ParagraphList::iterator &, ParagraphList::iterator &);
+
        ///
        LCursor cursor_;
 };
index 0717046e55c42f52372602d4825eaecdac3733af..64ec3a1f7dfd80fc370eff856d9570a5e1601971 100644 (file)
@@ -1,4 +1,9 @@
 
+2003-11-10  André Pönitz  <poenitz@gmx.net>
+
+       * BufferView.[Ch]:
+       * BufferView_pimpl.[Ch]: merge update() and updateInset()
+
 2003-11-10  André Pönitz  <poenitz@gmx.net>
 
        * lfuns.h: new LFUN_FINISHED_LEFT, LFUN_FINISHED_RIGHT,
index 2c28e2b81a1c885ebfbc990f65dd0db3be83b06e..d275b1c4ba90385996463e3bf6763d1a695f4fce 100644 (file)
@@ -157,8 +157,7 @@ bool changeDepth(BufferView * bv, LyXText * text, DEPTH_CHANGE type, bool test_o
                return text->changeDepth(type, true);
 
        bool const changed = text->changeDepth(type, false);
-       if (text->inset_owner)
-               bv->updateInset(text->inset_owner);
+       bv->update();
        return changed;
 }
 
index 347780ae81e469ac179b39e2eeaa78e5119620c3..3ca9d9b9cbaf303887455fea4daab8772d15b3d9 100644 (file)
@@ -74,7 +74,7 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0)
                lyxerr << "trying to dispatch to inset " << citem.inset_ << endl;
                DispatchResult res = citem.inset_->dispatch(cmd);
                if (res.update())
-                       bv_->updateInset(citem.inset_);
+                       bv_->update();
                if (res.dispatched()) {
                        lyxerr << " successfully dispatched to inset " << citem.inset_ << endl;
                        return DispatchResult(true, true);
index 658a4a25f7812f03c6641d8e25cea3e9cbe2f3fa..a018e067ce98cdbab7dfaa78207e044fc20929a1 100644 (file)
@@ -199,7 +199,7 @@ Buffer const * const LyXView::updateInset(InsetOld const * inset) const
        Buffer const * buffer_ptr = 0;
        if (inset) {
                buffer_ptr = bufferview_->buffer();
-               bufferview_->updateInset(inset);
+               bufferview_->update();
        }
        return buffer_ptr;
 }
index f7bb99dd6b6c54f92a2b70e642ac26f83f0b2850..3b18f098546527befba9f237da965e874af46e2b 100644 (file)
@@ -75,7 +75,7 @@ InsetBibitem::priv_dispatch(FuncRequest const & cmd,
                if (p.getCmdName().empty())
                        return DispatchResult(true, true);
                setParams(p);
-               cmd.view()->updateInset(this);
+               cmd.view()->update();
                cmd.view()->fitCursor();
                return DispatchResult(true, true);
        }
index e626f12b3d1ccea1b1255e6c1732fbc09ada8a05..c1902b32bf30a2785f04660eaceadbe895bad425 100644 (file)
@@ -180,7 +180,6 @@ InsetBox::priv_dispatch(FuncRequest const & cmd,
                lyxerr << "InsetBox::dispatch MODIFY" << endl;
                InsetBoxMailer::string2params(cmd.argument, params_);
                setButtonLabel();
-               bv->updateInset(this);
                result.dispatched(true);
                result.update(true);
                return result;
index b8cc58517ad20fa954fd2d60178a6b7ac1427ae3..d54b7b64973db80f969f36895d0682b5473c6819 100644 (file)
@@ -128,7 +128,6 @@ InsetBranch::priv_dispatch(FuncRequest const & cmd,
                InsetBranchMailer::string2params(cmd.argument, params);
                params_.branch = params.branch;
                setButtonLabel();
-               bv->updateInset(this);
                return DispatchResult(true, true);
        }
 
index cf916801563d596619d4b59c81f00c4200e3e880..1c86249bc0d093dcd494040657ff894ff2687449 100644 (file)
@@ -205,7 +205,6 @@ DispatchResult InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
                        collapsed_ = false;
                        edit(bv, true);
                        bv->buffer()->markDirty();
-                       bv->updateInset(this);
                        bv->update();
                        return result;
                }
@@ -221,7 +220,7 @@ DispatchResult InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
                                return result;
                        }
                        result.update(true);
-                       bv->updateInset(this);
+                       bv->update();
                        bv->buffer()->markDirty();
                } else if (!collapsed_ && cmd.y > button_dim.y2) {
                        lyxerr << "InsetCollapsable::lfunMouseRelease 3" << endl;
@@ -283,7 +282,7 @@ void InsetCollapsable::edit(BufferView * bv, int x, int y)
                collapsed_ = false;
                // set this only here as it should be recollapsed only if
                // it was already collapsed!
-               bv->updateInset(this);
+               bv->update();
                bv->buffer()->markDirty();
                inset.edit(bv, x, y);
        } else {
@@ -401,7 +400,7 @@ void InsetCollapsable::open(BufferView * bv)
                return;
 
        collapsed_ = false;
-       bv->updateInset(this);
+       bv->update();
 }
 
 
@@ -411,7 +410,7 @@ void InsetCollapsable::close(BufferView * bv) const
                return;
 
        collapsed_ = true;
-       bv->updateInset(this);
+       bv->update();
 }
 
 
index 544d25a7da1a835d95fd66c63c66ce4c7f3c82cd..207a56d2e771af9fa8b765ba6d9dbe642da6ad78 100644 (file)
@@ -99,7 +99,7 @@ InsetCommand::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                        return DispatchResult(false);
 
                setParams(p);
-               cmd.view()->updateInset(this);
+               cmd.view()->update();
                return DispatchResult(true, true);
        }
 
index 03cd6fee2465a1725b70144f96bf391b40ca92bc..9cfab1397e24a303fdf91acb25959697ea2041c6 100644 (file)
@@ -427,7 +427,7 @@ InsetERT::priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos)
                InsetERT::ERTStatus status_;
                InsetERTMailer::string2params(cmd.argument, status_);
                status(bv, status_);
-               bv->updateInset(this);
+               bv->update();
                return DispatchResult(true, true);
        }
 
@@ -561,7 +561,7 @@ void InsetERT::status(BufferView * bv, ERTStatus const st) const
                break;
        }
        if (bv) {
-               bv->updateInset(this);
+               bv->update();
                bv->buffer()->markDirty();
        }
 }
index 714f3327fd8a54c3a2d3066c092dfdd948da3391..b6239cc34b3fdbe08c175601819349949031036d 100644 (file)
@@ -449,7 +449,7 @@ InsetExternal::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                InsetExternalParams p;
                InsetExternalMailer::string2params(cmd.argument, buffer, p);
                setParams(p, buffer);
-               cmd.view()->updateInset(this);
+               cmd.view()->update();
                return DispatchResult(true, true);
        }
 
index e5510c4bdca8d387c72fa1a6fcdcd350e86644c0..801a180e4c7df040d0062b21b00adcabe0ce2b85 100644 (file)
@@ -175,7 +175,7 @@ InsetFloat::priv_dispatch(FuncRequest const & cmd,
                params_.wide      = params.wide;
 
                wide(params_.wide, cmd.view()->buffer()->params());
-               cmd.view()->updateInset(this);
+               cmd.view()->update();
                return DispatchResult(true, true);
        }
 
index ec3387a4c8918410ee28318e2a4cb865074bd676..949120d37b27956d817edeb0559c1e957ce0348b 100644 (file)
@@ -201,7 +201,7 @@ InsetGraphics::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                InsetGraphicsMailer::string2params(cmd.argument, buffer, p);
                if (!p.filename.empty()) {
                        setParams(p);
-                       cmd.view()->updateInset(this);
+                       cmd.view()->update();
                }
                return DispatchResult(true, true);
        }
index db89cc757cdf43996d9b8a133f89d6db8f43bef0..88821066dfecae2e11c584d33462caeb940ce34b 100644 (file)
@@ -118,7 +118,7 @@ InsetInclude::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                InsetIncludeMailer::string2params(cmd.argument, p);
                if (!p.getCmdName().empty()) {
                        set(p, *cmd.view()->buffer());
-                       cmd.view()->updateInset(this);
+                       cmd.view()->update();
                }
                return DispatchResult(true, true);
        }
index 16978b739845e99c8e579be621d4c868f9a107e7..5f225ae608180c68d9a9fcc47e4a183be1011351 100644 (file)
@@ -83,7 +83,7 @@ InsetLabel::priv_dispatch(FuncRequest const & cmd,
                }
 
                setParams(p);
-               bv->updateInset(this);
+               bv->update();
                return DispatchResult(true, true);
        }
 
index bb9ca071331e75d4d3ce6ecdffefad83f5ad78e4..cf2d3f9ea83a60dfdca60cefe0671e8c0f5f33c3 100644 (file)
@@ -106,7 +106,7 @@ InsetMinipage::priv_dispatch(FuncRequest const & cmd,
                InsetMinipageMailer::string2params(cmd.argument, params);
                params_.pos   = params.pos;
                params_.width = params.width;
-               cmd.view()->updateInset(this);
+               cmd.view()->update();
                return DispatchResult(true, true);
        }
 
index 1717ce70c38089d141bb0f3ab426a4ca24bfb184..655ac167024e51b35c0d16422163cc24fd37296f 100644 (file)
@@ -141,7 +141,7 @@ InsetNote::priv_dispatch(FuncRequest const & cmd,
        case LFUN_INSET_MODIFY: {
                InsetNoteMailer::string2params(cmd.argument, params_);
                setButtonLabel();
-               bv->updateInset(this);
+               bv->update();
                return DispatchResult(true, true);
        }
 
index e140e3abcc7e96c74a1ebc1e2546952bac56d026..d293e1d61108071f9ef53a4ce40d09301db950fb 100644 (file)
@@ -378,7 +378,7 @@ string const InsetTabular::editMessage() const
 
 void InsetTabular::updateLocal(BufferView * bv) const
 {
-       bv->updateInset(this);
+       bv->update();
        resetPos(bv);
 }
 
@@ -522,7 +522,7 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                                scroll(cmd.view(), static_cast<float>(strToDbl(cmd.argument)));
                        else
                                scroll(cmd.view(), strToInt(cmd.argument));
-                       cmd.view()->updateInset(this);
+                       cmd.view()->update();
                        return DispatchResult(true, true);
                }
 
index 68c7a4ce19f12f35ca94e5abdc48e8c3638cc8bf..a871874b53ea8baa5eb6d435528fd7e3173cb04b 100644 (file)
@@ -290,7 +290,7 @@ void InsetText::updateLocal(BufferView * bv, bool /*mark_dirty*/)
                text_.selection.cursor = text_.cursor;
 
        bv->fitCursor();
-       bv->updateInset(this);
+       bv->update();
        bv->owner()->view_state_changed();
        bv->owner()->updateMenubar();
        bv->owner()->updateToolbar();
index 8a30af6f541a2845c0f5033e63ef2a7214fd0285..b1c32be963a06bedbdb8a7e1e80285fa9dcb4f80 100644 (file)
@@ -91,7 +91,7 @@ InsetWrap::priv_dispatch(FuncRequest const & cmd,
                params_.placement = params.placement;
                params_.width     = params.width;
 
-               cmd.view()->updateInset(this);
+               cmd.view()->update();
                return DispatchResult(true, true);
        }
 
index 60c4bab90031eceff8847989f35ee73a0f666571..0bc7e235d3ebdb38895b6a21f1a9e72ddd7bbcd1 100644 (file)
@@ -99,7 +99,7 @@ UpdatableInset::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                                scroll(cmd.view(), static_cast<float>(strToDbl(cmd.argument)));
                        else
                                scroll(cmd.view(), strToInt(cmd.argument));
-                       cmd.view()->updateInset(this);
+                       cmd.view()->update();
                        return DispatchResult(true, true);
                }
 
index d9dd11a923385f100e9192c8825f4e8118ecd9de..1ce996a4e54b177c14dcd9e56b8f60dce4963b57 100644 (file)
@@ -155,15 +155,13 @@ string const InsetFormulaBase::editMessage() const
 void InsetFormulaBase::insetUnlock(BufferView * bv)
 {
        if (mathcursor) {
-               if (mathcursor->inMacroMode()) {
+               if (mathcursor->inMacroMode())
                        mathcursor->macroModeClose();
-                       bv->updateInset(this);
-               }
                releaseMathCursor(bv);
        }
        if (bv->buffer())
                generatePreview(*bv->buffer());
-       bv->updateInset(this);
+       bv->update();
 }
 
 
@@ -209,7 +207,7 @@ void InsetFormulaBase::fitInsetCursor(BufferView * bv) const
 void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
 {
        if (mathcursor)
-               bv->updateInset(this);
+               bv->update();
 }
 
 
@@ -219,7 +217,7 @@ DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
                return DispatchResult(false);
 
        BufferView * bv = cmd.view();
-       bv->updateInset(this);
+       bv->update();
        //lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl;
 
        if (cmd.button() == mouse_button::button3) {
@@ -238,7 +236,7 @@ DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
                mathcursor->selClear();
                mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
                mathcursor->insert(ar);
-               bv->updateInset(this);
+               bv->update();
                return DispatchResult(true, true);
        }
 
@@ -285,7 +283,7 @@ DispatchResult InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
                return DispatchResult(true, true);
        }
 
-       bv->updateInset(this);
+       bv->update();
        return DispatchResult(true, true);
 }
 
@@ -313,7 +311,7 @@ DispatchResult InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
 
        BufferView * bv = cmd.view();
        mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
-       bv->updateInset(this);
+       bv->update();
        return DispatchResult(true, true);
 }
 
@@ -326,7 +324,7 @@ void InsetFormulaBase::edit(BufferView * bv, bool left)
        bv->cursor().push(this); 
        // if that is removed, we won't get the magenta box when entering an
        // inset for the first time
-       bv->updateInset(this);
+       bv->update();
 }
 
 
@@ -340,7 +338,7 @@ void InsetFormulaBase::edit(BufferView * bv, int x, int y)
        bv->cursor().push(this); 
        // if that is removed, we won't get the magenta box when entering an
        // inset for the first time
-       bv->updateInset(this);
+       bv->update();
 }
 
 
@@ -739,7 +737,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
        }
 
        if (result == DispatchResult(true, true))
-               bv->updateInset(this);
+               bv->update();
 
        mathcursor->normalize();
        mathcursor->touch();
@@ -862,7 +860,7 @@ bool InsetFormulaBase::searchForward(BufferView * bv, string const & str,
                        mathcursor->setSelection(it, ar.size());
                        current = it;
                        it.jump(ar.size());
-                       bv->updateInset(this);
+                       bv->update();
                        return true;
                }
        }
index 124cdaf48fb2a8bf43afb431640e9d3bc3a1f40c..fe8c5ddd9dc059f5fcba26165af59832cbd2882d 100644 (file)
@@ -273,7 +273,7 @@ void LyXText::toggleInset()
        else
                inset->open(bv());
 
-       bv()->updateInset(inset);
+       bv()->update();
 }
 
 
@@ -724,8 +724,7 @@ void LyXText::setParagraph(
        setCursor(selection.end.par(), selection.end.pos());
        setSelection();
        setCursor(tmpcursor.par(), tmpcursor.pos());
-       if (inset_owner)
-               bv()->updateInset(inset_owner);
+       bv()->update();
 }
 
 
index 870c3ff5c65e9345061c8f1e16a73b33cb1cbc42..09eecd3e14d3559da66c3c12ce7f8fc0f0a6764f 100644 (file)
@@ -267,12 +267,12 @@ InsetOld * LyXText::checkInsetHit(int & x, int & y)
                InsetList::iterator iend = pit->insetlist.end();
                for ( ; iit != iend; ++iit) {
                        InsetOld * inset = iit->inset;
-                       lyxerr << "examining inset " << inset
-                               << " xy: " << inset->x() << "/" << inset->y()
-                               << " x: " << inset->x() << "..." << inset->x() + inset->width()
-                               << " y: " << inset->y() - inset->ascent() << "..."
-                               << inset->y() + inset->descent()
-                               << endl;
+                       //lyxerr << "examining inset " << inset
+                       //      << " xy: " << inset->x() << "/" << inset->y()
+                       //      << " x: " << inset->x() << "..." << inset->x() + inset->width()
+                       //      << " y: " << inset->y() - inset->ascent() << "..."
+                       //      << inset->y() + inset->descent()
+                       //      << endl;
                        if (x >= inset->x()
                            && x <= inset->x() + inset->width()
                            && y >= inset->y() - inset->ascent()
@@ -471,7 +471,7 @@ void specialChar(LyXText * lt, BufferView * bv, InsetSpecialChar::Kind kind)
        if (!bv->insertInset(new_inset))
                delete new_inset;
        else
-               bv->updateInset(new_inset);
+               bv->update();
 }