]> git.lyx.org Git - features.git/commitdiff
Change DispatchResult semantics a bit.
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 3 Nov 2003 19:52:47 +0000 (19:52 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 3 Nov 2003 19:52:47 +0000 (19:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8021 a592a061-630c-0410-9148-cb99ea01b6c8

37 files changed:
src/ChangeLog
src/cursor.C
src/dispatchresult.h
src/insets/ChangeLog
src/insets/insetbibitem.C
src/insets/insetbibtex.C
src/insets/insetbox.C
src/insets/insetbranch.C
src/insets/insetcite.C
src/insets/insetcollapsable.C
src/insets/insetcommand.C
src/insets/insetert.C
src/insets/insetexternal.C
src/insets/insetfloat.C
src/insets/insetfloatlist.C
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/insets/insetindex.C
src/insets/insetlabel.C
src/insets/insetminipage.C
src/insets/insetnote.C
src/insets/insetref.C
src/insets/insettabular.C
src/insets/insettext.C
src/insets/insettoc.C
src/insets/inseturl.C
src/insets/insetwrap.C
src/insets/updatableinset.C
src/lyxfunc.C
src/mathed/ChangeLog
src/mathed/formulabase.C
src/mathed/math_gridinset.C
src/mathed/math_hullinset.C
src/mathed/math_nestinset.C
src/mathed/math_scriptinset.C
src/mathed/ref_inset.C
src/text3.C

index 320fe5dee76951c044bd51160d1be1e21fce975f..14c867dbd05ef023ce9f3d8dc76a6d608ca82c4f 100644 (file)
@@ -1,3 +1,16 @@
+2003-11-03  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * text3.C (dispatch): adjust for new DisptchResult semantics.
+
+       * lyxfunc.C (dispatch): handle update when return from
+       Cursor::dispatch, adjust for new DispatchResult semantics.
+
+       * dispatchresult.h: drop NOUPDATE from dispatch_result_t. Make
+       DispatchResult(true) mean to not update. Add class functions for
+       setting dispatched and update, as well as reading.
+
+       * cursor.C (dispatch): don't handle update here
+
 2003-11-03  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * trans_mgr.h: store t1_ and t2_ in scoped_ptr
index 32257acfc0ba5512ecbe01fd48af89be0f394257..e6e59eae0eb6d7b837cb8a13418eed8c820b43d1 100644 (file)
@@ -32,12 +32,8 @@ DispatchResult Cursor::dispatch(FuncRequest const & cmd)
                DispatchResult res = data_[i].inset_->dispatch(cmd);
                lyxerr << "   result: " << res.val() << endl;
 
-               if (res.dispatched()) {
-                       if (res.val() != NOUPDATE) {
-                               //update();
-                       }
-                       return DispatchResult(true);
-               }
+               if (res.dispatched())
+                       return res;
 
                lyxerr << "# unhandled result: " << res.val() << endl;
        }
index 5ecfb35dbbcb87adb132a1778ece31cc29133a26..1e4d801eef52fb2bdc2160c49cb64708ffb0f272 100644 (file)
 */
 enum dispatch_result_t {
        NONE = 0,
-       NOUPDATE,
        FINISHED,
        FINISHED_RIGHT,
        FINISHED_UP,
        FINISHED_DOWN
 };
 
+
 /** \c DispatchResult is a wrapper for dispatch_result_t.
  *  It can be forward-declared and passed as a function argument without
  *  having to expose insetbase.h.
@@ -47,15 +47,27 @@ public:
                : dispatched_(false), val_(NONE) {}
        explicit
        DispatchResult(bool dis)
-               : dispatched_(dis), val_(NONE) {}
+               : dispatched_(dis), update_(false), val_(NONE) {}
+       DispatchResult(bool dis, bool update)
+               : dispatched_(dis), update_(true), val_(NONE) {}
        DispatchResult(bool dis, dispatch_result_t val)
-               : dispatched_(dis), val_(val) {}
+               : dispatched_(dis), update_(false), val_(val) {}
        dispatch_result_t val() const { return val_; }
        bool dispatched() const {
                return dispatched_;
        }
+       void dispatched(bool dis) {
+               dispatched_ = dis;
+       }
+       bool update() const {
+               return update_;
+       }
+       void update(bool up) {
+               update_ = up;
+       }
 private:
        bool dispatched_;
+       bool update_;
        dispatch_result_t val_;
 };
 
index 841eb0b773db9f1491e1b254ac717450d7064ecc..5a881ff1cb2b66a8fe1a381b1a11c55c92fcb395 100644 (file)
@@ -1,10 +1,14 @@
+2003-11-03  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * Inset::dispatch's: adjust for new DispatchResult semantics.
+       
 2003-11-03  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * render_base.h: make clone return an auto_ptr
        * render_button.C (clone): adjust
        * render_graphic.C (clone): adjust
        * render_preview.C (clone): adjust
-       
+
        * insettheorem.C (clone): return an auto_ptr
 
        * insettext.C (priv_dispatch): exception safety
index f76b685cc66f01d3e2c700dd24c9799bba51f496..b35f60585073dc691a24b3c7d8b58ac3a9f315cb 100644 (file)
@@ -67,17 +67,17 @@ InsetBibitem::priv_dispatch(FuncRequest const & cmd,
 
        case LFUN_INSET_EDIT:
                InsetCommandMailer("bibitem", *this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_INSET_MODIFY: {
                InsetCommandParams p;
                InsetCommandMailer::string2params(cmd.argument, p);
                if (p.getCmdName().empty())
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                setParams(p);
                cmd.view()->updateInset(this);
                cmd.view()->fitCursor();
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        default:
index 16f791d5507a9f1d7ee48577dc611303741e5e5f..69a40df55ee39e785bb51a32d8b68f589714c7b5 100644 (file)
@@ -92,31 +92,40 @@ DispatchResult
 InsetBibtex::priv_dispatch(FuncRequest const & cmd,
                           idx_type & idx, pos_type & pos)
 {
+       DispatchResult result(false);
+       
        switch (cmd.action) {
 
        case LFUN_INSET_DIALOG_SHOW:
                InsetCommandMailer("bibtex", *this).showDialog(cmd.view());
-               return DispatchResult(true);
+               result.dispatched(true);
+               break;
+               
        case LFUN_MOUSE_RELEASE:
                if (button().box().contains(cmd.x, cmd.y))
                        InsetCommandMailer("bibtex", *this).showDialog(cmd.view());
-               return DispatchResult(true);
-
+               result.dispatched(true);
+               break;
+               
        case LFUN_INSET_MODIFY: {
                InsetCommandParams p;
                InsetCommandMailer::string2params(cmd.argument, p);
-               if (p.getCmdName().empty())
-                       return DispatchResult(true);
-               setParams(p);
-               return  DispatchResult(true);
+               if (!p.getCmdName().empty())
+                       setParams(p);
+               result.dispatched(true);
+               result.update(true);
        }
-
+               break;
+               
        default:
-               return InsetCommand::priv_dispatch(cmd, idx, pos);
+               result = InsetCommand::priv_dispatch(cmd, idx, pos);
+               break;
        }
 
+       return result;
 }
 
+
 string const InsetBibtex::getScreenLabel(Buffer const &) const
 {
        return _("BibTeX Generated References");
index 36842210d9c4277e466a57d537278f9738650c51..4a8ef7aa01fc90eaaf87edd8f2b48c73d882a33c 100644 (file)
@@ -169,6 +169,7 @@ DispatchResult
 InsetBox::priv_dispatch(FuncRequest const & cmd,
                        idx_type & idx, pos_type & pos)
 {
+       DispatchResult result(false);
        BufferView * bv = cmd.view();
 
        switch (cmd.action) {
@@ -177,11 +178,14 @@ InsetBox::priv_dispatch(FuncRequest const & cmd,
                InsetBoxMailer::string2params(cmd.argument, params_);
                setButtonLabel();
                bv->updateInset(this);
-               return DispatchResult(true);
+               result.dispatched(true);
+               result.update(true);
+               break;
        }
        case LFUN_INSET_DIALOG_UPDATE:
                InsetBoxMailer(*this).updateDialog(bv);
-               return DispatchResult(true);
+               result.dispatched(true);
+               break;
 
        case LFUN_MOUSE_RELEASE:
                if (cmd.button() == mouse_button::button3 && hitButton(cmd)) {
@@ -191,8 +195,11 @@ InsetBox::priv_dispatch(FuncRequest const & cmd,
                // fallthrough:
 
        default:
-               return InsetCollapsable::priv_dispatch(cmd, idx, pos);
+               result = InsetCollapsable::priv_dispatch(cmd, idx, pos);
+               break;
        }
+       
+       return result;
 }
 
 
index b3416ae9dc3a6b3e672254c0237b967633ef4cf7..4cc82711fe8ef90e1bf3e5998f007ea3f48865d2 100644 (file)
@@ -123,23 +123,23 @@ InsetBranch::priv_dispatch(FuncRequest const & cmd,
 {
        BufferView * bv = cmd.view();
        switch (cmd.action) {
-       case LFUN_INSET_MODIFY:
-               {
+       case LFUN_INSET_MODIFY: {
                InsetBranchParams params;
                InsetBranchMailer::string2params(cmd.argument, params);
                params_.branch = params.branch;
                setButtonLabel();
                bv->updateInset(this);
-               return DispatchResult(true);
-               }
+               return DispatchResult(true, true);
+       }
        case LFUN_INSET_EDIT:
                if (cmd.button() != mouse_button::button3)
                        return InsetCollapsable::priv_dispatch(cmd, idx, pos);
-
                return DispatchResult(false);
+
        case LFUN_INSET_DIALOG_UPDATE:
                InsetBranchMailer("branch", *this).updateDialog(bv);
                return DispatchResult(true);
+
        case LFUN_MOUSE_RELEASE:
                if (cmd.button() == mouse_button::button3 && hitButton(cmd)) {
                    InsetBranchMailer("branch", *this).showDialog(bv);
index ef07a4c401ffefa4b19b19896a9dccabe41c6ae8..187c0b663a8db1e6d4d9ec374ec62f6c5b21ebf1 100644 (file)
@@ -316,7 +316,7 @@ InsetCitation::priv_dispatch(FuncRequest const & cmd,
        switch (cmd.action) {
        case LFUN_INSET_EDIT:
                InsetCommandMailer("citation", *this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return InsetCommand::priv_dispatch(cmd, idx, pos);
index 1e9d18f1dde0982c2be588147f05f01f8c6a8e78..c5587cb3e0e028f6221a31a52ecfd30311c91fe8 100644 (file)
@@ -234,7 +234,7 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
                bv->updateInset(this);
                bv->buffer()->markDirty();
        } else if (!collapsed_ && cmd.y > button_dim.y2) {
-               ret = inset.dispatch(adjustCommand(cmd)) == DispatchResult(true);
+               ret = inset.dispatch(adjustCommand(cmd)) == DispatchResult(true, true);
        }
        if (cmd.button() == mouse_button::button3 && !ret)
                showInsetDialog(bv);
@@ -310,14 +310,14 @@ InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
                                        if (bv->lockInset(this))
                                                inset.dispatch(cmd);
                                }
-                               return DispatchResult(true);
+                               return DispatchResult(true, true);
                        }
 
 #ifdef WITH_WARNINGS
 #warning Fix this properly in BufferView_pimpl::workAreaButtonRelease
 #endif
                        if (cmd.button() == mouse_button::button3)
-                               return DispatchResult(true);
+                               return DispatchResult(true, true);
 
                        UpdatableInset::priv_dispatch(cmd, idx, pos);
 
@@ -327,13 +327,13 @@ InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
                                // it was already collapsed!
                                first_after_edit = true;
                                if (!bv->lockInset(this))
-                                       return DispatchResult(true);
+                                       return DispatchResult(true, true);
                                bv->updateInset(this);
                                bv->buffer()->markDirty();
                                inset.dispatch(cmd);
                        } else {
                                if (!bv->lockInset(this))
-                                       return DispatchResult(true);
+                                       return DispatchResult(true, true);
                                if (cmd.y <= button_dim.y2) {
                                        FuncRequest cmd1 = cmd;
                                        cmd1.y = 0;
@@ -341,22 +341,22 @@ InsetCollapsable::priv_dispatch(FuncRequest const & cmd,
                                } else
                                        inset.dispatch(adjustCommand(cmd));
                        }
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
 
                case LFUN_MOUSE_PRESS:
                        if (!collapsed_ && cmd.y > button_dim.y2)
                                inset.dispatch(adjustCommand(cmd));
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_MOUSE_MOTION:
                        if (!collapsed_ && cmd.y > button_dim.y2)
                                inset.dispatch(adjustCommand(cmd));
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_MOUSE_RELEASE:
                        lfunMouseRelease(cmd);
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                default:
                        DispatchResult const result = inset.dispatch(cmd);
index d8576148ed46f024e2d90703a503569a8f5e0bc5..451079e749189cf4166ffaf17cf4459daf5eabbe 100644 (file)
@@ -100,12 +100,12 @@ InsetCommand::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
 
                setParams(p);
                cmd.view()->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_DIALOG_UPDATE:
                InsetCommandMailer(cmd.argument, *this).updateDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_MOUSE_RELEASE:
                return dispatch(FuncRequest(cmd.view(), LFUN_INSET_EDIT));
index d3a9417fcda8c48f6927e7ff29a021c4eabb62b6..77814f47e987a20253112e7c02ffeed444440e51 100644 (file)
@@ -466,28 +466,28 @@ InsetERT::priv_dispatch(FuncRequest const & cmd,
                 */
                inset.getLyXText(cmd.view())->fullRebreak();
                bv->updateInset(this);
-               result = DispatchResult(true);
+               result = DispatchResult(true, true);
        }
        break;
 
        case LFUN_MOUSE_PRESS:
                lfunMousePress(cmd);
-               result = DispatchResult(true);
+               result = DispatchResult(true, true);
                break;
 
        case LFUN_MOUSE_MOTION:
                lfunMouseMotion(cmd);
-               result = DispatchResult(true);
+               result = DispatchResult(true, true);
                break;
 
        case LFUN_MOUSE_RELEASE:
                lfunMouseRelease(cmd);
-               result = DispatchResult(true);
+               result = DispatchResult(true, true);
                break;
 
        case LFUN_LAYOUT:
                bv->owner()->setLayout(inset.paragraphs.begin()->layout()->name());
-               result = DispatchResult(true, NOUPDATE);
+               result = DispatchResult(true);
                break;
 
        default:
index 552dd15b62f25913451763ea46a0c3079f969253..6611c02da792f7214aec5e72d555a451c90c5e33 100644 (file)
@@ -439,7 +439,7 @@ InsetExternal::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                InsetExternalParams p;
                InsetExternalMailer::string2params(cmd.argument, buffer, p);
                external::editExternal(p, buffer);
-               return DispatchResult(true, NOUPDATE);
+               return DispatchResult(true);
        }
 
        case LFUN_INSET_MODIFY: {
@@ -450,17 +450,17 @@ InsetExternal::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                InsetExternalMailer::string2params(cmd.argument, buffer, p);
                setParams(p, buffer);
                cmd.view()->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_DIALOG_UPDATE:
                InsetExternalMailer(*this).updateDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_MOUSE_RELEASE:
        case LFUN_INSET_EDIT:
                InsetExternalMailer(*this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return DispatchResult(false);
index 757a55aeb8b0af8cac8de7685a7b5931f0498895..6c3aca0cdd12f49c42293b07d57270b5691175ee 100644 (file)
@@ -176,12 +176,12 @@ InsetFloat::priv_dispatch(FuncRequest const & cmd,
 
                wide(params_.wide, cmd.view()->buffer()->params());
                cmd.view()->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_DIALOG_UPDATE: {
                InsetFloatMailer(*this).updateDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        default:
index e24621809d9fb81286e4e4bead0e3d670d3ab176..d869762847b06c92144abccfec83587e747ec67f 100644 (file)
@@ -127,11 +127,11 @@ InsetFloatList::priv_dispatch(FuncRequest const & cmd,
                case LFUN_MOUSE_RELEASE:
                        if (button().box().contains(cmd.x, cmd.y))
                                InsetCommandMailer("toc", *this).showDialog(cmd.view());
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_INSET_DIALOG_SHOW:
                        InsetCommandMailer("toc", *this).showDialog(cmd.view());
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                default:
                        return InsetCommand::priv_dispatch(cmd, idx, pos);
index 05605ffc18d27b7922befeacf553120ccd90df94..94225b8c05356e2a9d3d3eee27b8a5a219a55bf1 100644 (file)
@@ -203,17 +203,17 @@ InsetGraphics::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                        setParams(p);
                        cmd.view()->updateInset(this);
                }
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_DIALOG_UPDATE:
                InsetGraphicsMailer(*this).updateDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_INSET_EDIT:
        case LFUN_MOUSE_RELEASE:
                InsetGraphicsMailer(*this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return DispatchResult(false);
index fdb5b0eb9825dd567b9b9a8854b5647f829f6f48..6f1ae1a6703255c1fd57ae0addeed156df34274a 100644 (file)
@@ -120,21 +120,21 @@ InsetInclude::priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &)
                        set(p, *cmd.view()->buffer());
                        cmd.view()->updateInset(this);
                }
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_DIALOG_UPDATE:
                InsetIncludeMailer(*this).updateDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_MOUSE_RELEASE:
                if (button_.box().contains(cmd.x, cmd.y))
                        InsetIncludeMailer(*this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_INSET_DIALOG_SHOW:
                InsetIncludeMailer(*this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return DispatchResult(false);
index f8f91ad4c0b4d045a5edb8e78d09246db936d140..248c9fc4007d07d1c11a4d39bdfb04dc7bd54c41 100644 (file)
@@ -68,7 +68,7 @@ InsetIndex::priv_dispatch(FuncRequest const & cmd,
        switch (cmd.action) {
                case LFUN_INSET_EDIT:
                        InsetCommandMailer("index", *this).showDialog(cmd.view());
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                default:
                        return InsetCommand::priv_dispatch(cmd, idx, pos);
index b5b16cf8aee856ac179c057df416514a0bfb9eb1..b96d27ef4d8361820cb2f53a65b90a6a63341629 100644 (file)
@@ -68,7 +68,7 @@ InsetLabel::priv_dispatch(FuncRequest const & cmd,
 
        case LFUN_INSET_EDIT:
                InsetCommandMailer("label", *this).showDialog(bv);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
                break;
 
        case LFUN_INSET_MODIFY: {
@@ -85,7 +85,7 @@ InsetLabel::priv_dispatch(FuncRequest const & cmd,
 
                setParams(p);
                bv->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        default:
index 73685cc2630ac5897733b28f889d84fca2f9c32d..29d82bb4733ade335be17d7aaf6bfc259425056c 100644 (file)
@@ -112,12 +112,12 @@ InsetMinipage::priv_dispatch(FuncRequest const & cmd,
                 * with ugliness like this ... */
                inset.getLyXText(cmd.view())->fullRebreak();
                cmd.view()->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_DIALOG_UPDATE:
                InsetMinipageMailer(*this).updateDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return InsetCollapsable::priv_dispatch(cmd, idx, pos);
index b627811694ca9de0d1618a50dbe25b66d3e1d5d4..66c9896b022f3be3686638b9007848ab7d8c388f 100644 (file)
@@ -142,7 +142,7 @@ InsetNote::priv_dispatch(FuncRequest const & cmd,
                InsetNoteMailer::string2params(cmd.argument, params_);
                setButtonLabel();
                bv->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_EDIT:
@@ -152,12 +152,12 @@ InsetNote::priv_dispatch(FuncRequest const & cmd,
 
        case LFUN_INSET_DIALOG_UPDATE:
                InsetNoteMailer("note", *this).updateDialog(bv);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_MOUSE_RELEASE:
                if (cmd.button() == mouse_button::button3 && hitButton(cmd)) {
                        InsetNoteMailer("note", *this).showDialog(bv);
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
                // fallthrough:
 
index 2e8e385fb38d404a5d1462ae71407b614dc2b462..a6a1538e8dcf98dd269248aa61fb26de58428b78 100644 (file)
@@ -58,7 +58,7 @@ InsetRef::priv_dispatch(FuncRequest const & cmd,
                                dispatch(FuncRequest(LFUN_REF_GOTO, getContents()));
                else
                        InsetCommandMailer("ref", *this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return InsetCommand::priv_dispatch(cmd, idx, pos);
index 65fa7c3bee2a0d89888802f29ce9ccda3c0c1782..88d23a3968080a290ceb5b38fec445d91c32a562 100644 (file)
@@ -677,7 +677,7 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
 
                if (!bv->lockInset(this)) {
                        lyxerr << "InsetTabular::Cannot lock inset" << endl;
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
 
                finishUndo();
@@ -713,7 +713,7 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
                                activateCellInset(bv, cmd.x - inset_x, cmd.y - inset_y, cmd.button());
                        }
                }
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        if (result.dispatched()) {
@@ -726,18 +726,18 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
 
        bool hs = hasSelection();
 
-       result = DispatchResult(true);
+       result = DispatchResult(true, true);
        // this one have priority over the locked InsetText, if we're not already
        // inside another tabular then that one get's priority!
        if (getFirstLockingInsetOfType(InsetOld::TABULAR_CODE) == this) {
                switch (cmd.action) {
                case LFUN_MOUSE_PRESS:
                        lfunMousePress(cmd);
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_MOUSE_MOTION:
                        lfunMouseMotion(cmd);
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_MOUSE_RELEASE:
                        return DispatchResult(lfunMouseRelease(cmd));
@@ -753,7 +753,7 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
                        if (hs)
                                updateLocal(bv);
                        if (!the_locking_inset)
-                               return DispatchResult(true, NOUPDATE);
+                               return DispatchResult(true);
                        return result;
                // this to avoid compiler warnings.
                default:
@@ -766,15 +766,15 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
        if (the_locking_inset) {
                result = the_locking_inset->dispatch(cmd);
                if (result.dispatched()) {
-                       if (result.val() == NOUPDATE) {
+                       if (result.update()) {
+                               updateLocal(bv);
+                       } else {
                                int const sc = scroll();
                                resetPos(bv);
                                if (sc != scroll()) {
                                        // inset has been scrolled
                                        updateLocal(bv);
                                }
-                       } else {
-                               updateLocal(bv);
                        }
                        return result;
                } else if (result.val() == FINISHED_UP) {
@@ -793,7 +793,7 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
                }
        }
 
-       result = DispatchResult(true);
+       result = DispatchResult(true, true);
        switch (action) {
                // --- Cursor Movements ----------------------------------
        case LFUN_RIGHTSEL: {
@@ -1088,7 +1088,7 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
                        case LFUN_UNDERLINE:
                        case LFUN_FONT_SIZE:
                                if (bv->dispatch(FuncRequest(bv, action, arg)))
-                                       result = DispatchResult(true);
+                                       result = DispatchResult(true, true);
                                break;
                        default:
                                break;
@@ -1406,17 +1406,17 @@ DispatchResult InsetTabular::moveRight(BufferView * bv, bool lock)
 {
        if (lock && !old_locking_inset) {
                if (activateCellInset(bv))
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
        } else {
                bool moved = isRightToLeft(bv)
                        ? movePrevCell(bv) : moveNextCell(bv);
                if (!moved)
                        return DispatchResult(false, FINISHED_RIGHT);
                if (lock && activateCellInset(bv))
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
        }
        resetPos(bv);
-       return DispatchResult(true, NOUPDATE);
+       return DispatchResult(true);
 }
 
 
@@ -1427,9 +1427,9 @@ DispatchResult InsetTabular::moveLeft(BufferView * bv, bool lock)
                return DispatchResult(false, FINISHED);
        // behind the inset
        if (lock && activateCellInset(bv, 0, 0, mouse_button::none, true))
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        resetPos(bv);
-       return DispatchResult(true, NOUPDATE);
+       return DispatchResult(true);
 }
 
 
@@ -1448,9 +1448,9 @@ DispatchResult InsetTabular::moveUp(BufferView * bv, bool lock)
                        x -= cursorx_ + tabular.getBeginningOfTextInCell(actcell);
                }
                if (activateCellInset(bv, x, 0))
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
        }
-       return DispatchResult(true, NOUPDATE);
+       return DispatchResult(true);
 }
 
 
@@ -1469,9 +1469,9 @@ DispatchResult InsetTabular::moveDown(BufferView * bv, bool lock)
                        x -= cursorx_ + tabular.getBeginningOfTextInCell(actcell);
                }
                if (activateCellInset(bv, x, 0))
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
        }
-       return DispatchResult(true, NOUPDATE);
+       return DispatchResult(true);
 }
 
 
index b8d80cf7ae232a14ad1cb96421a24c5740f92733..458b3fbe9bb65b23e4f99cef7535e510d9e6ed53 100644 (file)
@@ -549,7 +549,7 @@ bool InsetText::lfunMouseRelease(FuncRequest const & cmd)
        if (the_locking_inset) {
                DispatchResult const res = the_locking_inset->dispatch(cmd1);
 
-               return res.dispatched() || res.val() >= NOUPDATE;
+               return res.dispatched();
        }
 
        int tmp_x = cmd.x;
@@ -561,7 +561,7 @@ bool InsetText::lfunMouseRelease(FuncRequest const & cmd)
        // We still need to deal properly with the whole relative vs.
        // absolute mouse co-ords thing in a realiable, sensible way
        DispatchResult const res = inset->dispatch(cmd1);
-       bool const ret = res.dispatched() || res.val() >= NOUPDATE;
+       bool const ret = res.dispatched();
        updateLocal(bv, false);
        return ret;
 }
@@ -605,7 +605,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
 
                if (!bv->lockInset(this)) {
                        lyxerr[Debug::INSETS] << "Cannot lock inset" << endl;
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
 
                locked = true;
@@ -653,16 +653,16 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
                updateLocal(bv, false);
                // Tell the paragraph dialog that we've entered an insettext.
                bv->dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_MOUSE_PRESS:
                lfunMousePress(cmd);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_MOUSE_MOTION:
                lfunMouseMotion(cmd);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_MOUSE_RELEASE:
                return DispatchResult(lfunMouseRelease(cmd));
@@ -676,25 +676,27 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
 
        DispatchResult result = UpdatableInset::priv_dispatch(cmd, idx, pos);
        if (result.dispatched())
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
-       result = DispatchResult(true);
-       if (cmd.action < 0 && cmd.argument.empty())
+       result = DispatchResult(true, true);
+       if (cmd.action == LFUN_UNKNOWN_ACTION && cmd.argument.empty())
                return DispatchResult(false, FINISHED);
 
        if (the_locking_inset) {
                result = the_locking_inset->dispatch(cmd);
 
                if (result.dispatched()) {
-                       if (result.val() != NOUPDATE)
+                       if (result.update()) {
+                               result.update(false);
                                updateLocal(bv, false);
+                       }
                        return result;
                }
 
                switch (result.val()) {
                case FINISHED_RIGHT:
                        moveRightIntern(bv, false, false);
-                       result = DispatchResult(true);
+                       result = DispatchResult(true, true);
                        break;
                case FINISHED_UP:
                        result = moveUp(bv);
@@ -711,7 +713,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
                        }
                        break;
                default:
-                       result = DispatchResult(true);
+                       result = DispatchResult(true, true);
                        break;
                }
                the_locking_inset = 0;
@@ -752,7 +754,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
                }
                text_.selection.cursor = text_.cursor;
                updflag = true;
-               result = DispatchResult(true, NOUPDATE);
+               result = DispatchResult(true);
                break;
 
        // cursor movements that need special handling
@@ -780,7 +782,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
                else {
                        text_.cursorPrevious();
                        text_.clearSelection();
-                       result = DispatchResult(true, NOUPDATE);
+                       result = DispatchResult(true);
                }
                break;
 
@@ -790,7 +792,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
                else {
                        text_.cursorNext();
                        text_.clearSelection();
-                       result = DispatchResult(true, NOUPDATE);
+                       result = DispatchResult(true);
                }
                break;
 
@@ -835,7 +837,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
 
        case LFUN_BREAKPARAGRAPH:
                if (!autoBreakRows_) {
-                       result = DispatchResult(true);
+                       result = DispatchResult(true, true);
                } else {
                        replaceSelection(bv->getLyXText());
                        text_.breakParagraph(paragraphs, 0);
@@ -845,7 +847,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
 
        case LFUN_BREAKPARAGRAPHKEEPLAYOUT:
                if (!autoBreakRows_) {
-                       result = DispatchResult(true);
+                       result = DispatchResult(true, true);
                } else {
                        replaceSelection(bv->getLyXText());
                        text_.breakParagraph(paragraphs, 1);
@@ -855,7 +857,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
 
        case LFUN_BREAKLINE: {
                if (!autoBreakRows_) {
-                       result = DispatchResult(true);
+                       result = DispatchResult(true, true);
                } else {
                        replaceSelection(bv->getLyXText());
                        auto_ptr<InsetNewline> ins(new InsetNewline);
@@ -923,8 +925,8 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
        if (result.val() >= FINISHED)
                bv->unlockInset(this);
 
-       if (result.val() == NOUPDATE)
-               result = DispatchResult(true);
+       if (result.val() == NONE)
+               result = DispatchResult(true, true);
        return result;
 }
 
@@ -1049,11 +1051,11 @@ InsetText::moveRightIntern(BufferView * bv, bool front,
        if (boost::next(c_par) == paragraphs.end() && cpos() >= c_par->size())
                return DispatchResult(false, FINISHED_RIGHT);
        if (activate_inset && checkAndActivateInset(bv, front))
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        text_.cursorRight(bv);
        if (!selecting)
                text_.clearSelection();
-       return DispatchResult(true, NOUPDATE);
+       return DispatchResult(true);
 }
 
 
@@ -1067,8 +1069,8 @@ InsetText::moveLeftIntern(BufferView * bv, bool front,
        if (!selecting)
                text_.clearSelection();
        if (activate_inset && checkAndActivateInset(bv, front))
-               return DispatchResult(true);
-       return DispatchResult(true, NOUPDATE);
+               return DispatchResult(true, true);
+       return DispatchResult(true);
 }
 
 
@@ -1078,7 +1080,7 @@ DispatchResult InsetText::moveUp(BufferView * bv)
                return DispatchResult(false, FINISHED_UP);
        text_.cursorUp(bv);
        text_.clearSelection();
-       return DispatchResult(true, NOUPDATE);
+       return DispatchResult(true);
 }
 
 
@@ -1088,7 +1090,7 @@ DispatchResult InsetText::moveDown(BufferView * bv)
                return DispatchResult(false, FINISHED_DOWN);
        text_.cursorDown(bv);
        text_.clearSelection();
-       return DispatchResult(true, NOUPDATE);
+       return DispatchResult(true);
 }
 
 
index a4f9fb17d122e067705372eef228217b682f1622..8854a3a17e4b73150f7a9eed26ae976ec21b720e 100644 (file)
@@ -82,11 +82,11 @@ InsetTOC::priv_dispatch(FuncRequest const & cmd,
        case LFUN_MOUSE_RELEASE:
                if (button().box().contains(cmd.x, cmd.y))
                        InsetCommandMailer("toc", *this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        case LFUN_INSET_DIALOG_SHOW:
                InsetCommandMailer("toc", *this).showDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return InsetCommand::priv_dispatch(cmd, idx, pos);
index 1cd18fe3b75c4691848f40e0e47c348e43fccd5b..67933a134cfe69d5edb295bd06e06f214831a3da 100644 (file)
@@ -51,7 +51,7 @@ InsetUrl::priv_dispatch(FuncRequest const & cmd,
        switch (cmd.action) {
                case LFUN_INSET_EDIT:
                        InsetCommandMailer("url", *this).showDialog(cmd.view());
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                default:
                        return InsetCommand::priv_dispatch(cmd, idx, pos);
        }
index 1432b3650cd3c3a5f7cb1522570aa2c912deec2d..e6795dbcc2c1433b4036ebced50e8e12ee936c70 100644 (file)
@@ -98,12 +98,12 @@ InsetWrap::priv_dispatch(FuncRequest const & cmd,
                params_.width     = params.width;
 
                cmd.view()->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        case LFUN_INSET_DIALOG_UPDATE:
                InsetWrapMailer(*this).updateDialog(cmd.view());
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        default:
                return InsetCollapsable::priv_dispatch(cmd, idx, pos);
index 56fc9d72df78289e8c2a9ecd3d5a5d9b8e09977f..6e1e7254057660d47d48894522acbe7cdf55f1d3 100644 (file)
@@ -125,7 +125,7 @@ UpdatableInset::priv_dispatch(FuncRequest const & ev, idx_type &, pos_type &)
                }
                ev.view()->updateInset(this);
 
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
        return DispatchResult(false);
 }
index e67eb2c8b0c9b6fdf7ee9e84e3ce1bc18e56238e..64bcf29385be2c0cec5c093841e082247abff3ea 100644 (file)
@@ -885,11 +885,17 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
        {
                Cursor cursor;
                buildCursor(cursor, *view());
-               if (cursor.dispatch(FuncRequest(func, view())).dispatched()) {
+               DispatchResult result =
+                       cursor.dispatch(FuncRequest(func, view()));
+
+               if (result.dispatched()) {
+                       if (result.update()) {
+                               view()->update();
+                       }
                        lyxerr << "dispatched by Cursor::dispatch()\n";
                        goto exit_with_message;
                }
-               lyxerr << "### NOT DispatchResult(true) BY Cursor::dispatch() ###\n";
+               lyxerr << "### NOT DispatchResult(true, true) BY Cursor::dispatch() ###\n";
        }
 #endif
 
@@ -934,6 +940,9 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
                        // Hand-over to inset's own dispatch:
                        result = inset->dispatch(FuncRequest(view(), action, argument));
                        if (result.dispatched()) {
+                               if (result.update())
+                                       view()->update();
+
                                goto exit_with_message;
                        }
 
index b8020d6613b24dc663163dbf02ad9ad4b40bd766..6f96b85f11f544f71a32527bf9adcc48cb2e2be9 100644 (file)
@@ -1,3 +1,7 @@
+2003-11-03  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * Adjust for new DispatchResult semantics.
+
 2003-11-03  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * math_parser.C (parse1): exception safety
index 6dc422cd8c18b8bc845e28706c5b1913e387687e..8d0a514cc21c21d5f8c00f2882f25ec2b7d5e210 100644 (file)
@@ -228,7 +228,7 @@ DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
                        lyxerr << "lfunMouseRelease: undispatched: " << cmd.button() << endl;
                        bv->owner()->getDialogs().show("mathpanel");
                }
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        if (cmd.button() == mouse_button::button2) {
@@ -238,7 +238,7 @@ DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
                mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
                mathcursor->insert(ar);
                bv->updateInset(this);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        if (cmd.button() == mouse_button::button1) {
@@ -250,7 +250,7 @@ DispatchResult InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd)
                //mathcursor = new MathCursor(this, x == 0);
                //metrics(bv);
                //mathcursor->setPos(x + xo_, y + yo_);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        return DispatchResult(false);
@@ -272,7 +272,7 @@ DispatchResult InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
 
        if (cmd.button() == mouse_button::button3) {
                mathcursor->dispatch(cmd);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        if (cmd.button() == mouse_button::button1) {
@@ -281,28 +281,28 @@ DispatchResult InsetFormulaBase::lfunMousePress(FuncRequest const & cmd)
                mathcursor->selClear();
                mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
                mathcursor->dispatch(cmd);
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        bv->updateInset(this);
-       return DispatchResult(true);
+       return DispatchResult(true, true);
 }
 
 
 DispatchResult InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
 {
        if (!mathcursor)
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        if (mathcursor->dispatch(FuncRequest(cmd)).dispatched())
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        // only select with button 1
        if (cmd.button() != mouse_button::button1)
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        if (abs(cmd.x - first_x) < 2 && abs(cmd.y - first_y) < 2)
-               return DispatchResult(true);
+               return DispatchResult(true, true);
 
        first_x = cmd.x;
        first_y = cmd.y;
@@ -313,7 +313,7 @@ DispatchResult InsetFormulaBase::lfunMouseMotion(FuncRequest const & cmd)
        BufferView * bv = cmd.view();
        mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
        bv->updateInset(this);
-       return DispatchResult(true);
+       return DispatchResult(true, true);
 }
 
 
@@ -349,7 +349,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                        // if that is removed, we won't get the magenta box when entering an
                        // inset for the first time
                        bv->updateInset(this);
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_MOUSE_PRESS:
                        //lyxerr << "Mouse single press" << endl;
@@ -400,7 +400,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
        case LFUN_RIGHTSEL:
                sel = true; // fall through...
        case LFUN_RIGHT:
-               result = mathcursor->right(sel) ? DispatchResult(true) : DispatchResult(false, FINISHED_RIGHT);
+               result = mathcursor->right(sel) ? DispatchResult(true, true) : DispatchResult(false, FINISHED_RIGHT);
                //lyxerr << "calling scroll 20" << endl;
                //scroll(bv, 20);
                // write something to the minibuffer
@@ -410,19 +410,19 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
        case LFUN_LEFTSEL:
                sel = true; // fall through
        case LFUN_LEFT:
-               result = mathcursor->left(sel) ? DispatchResult(true) : DispatchResult(true, FINISHED);
+               result = mathcursor->left(sel) ? DispatchResult(true, true) : DispatchResult(true, FINISHED);
                break;
 
        case LFUN_UPSEL:
                sel = true; // fall through
        case LFUN_UP:
-               result = mathcursor->up(sel) ? DispatchResult(true) : DispatchResult(false, FINISHED_UP);
+               result = mathcursor->up(sel) ? DispatchResult(true, true) : DispatchResult(false, FINISHED_UP);
                break;
 
        case LFUN_DOWNSEL:
                sel = true; // fall through
        case LFUN_DOWN:
-               result = mathcursor->down(sel) ? DispatchResult(true) : DispatchResult(false, FINISHED_DOWN);
+               result = mathcursor->down(sel) ? DispatchResult(true, true) : DispatchResult(false, FINISHED_DOWN);
                break;
 
        case LFUN_WORDSEL:
@@ -442,7 +442,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                sel = true; // fall through
        case LFUN_HOME:
        case LFUN_WORDLEFT:
-               result = mathcursor->home(sel) ? DispatchResult(true) : DispatchResult(true, FINISHED);
+               result = mathcursor->home(sel) ? DispatchResult(true, true) : DispatchResult(true, FINISHED);
                break;
 
        case LFUN_ENDSEL:
@@ -450,7 +450,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                sel = true; // fall through
        case LFUN_END:
        case LFUN_WORDRIGHT:
-               result = mathcursor->end(sel) ? DispatchResult(true) : DispatchResult(false, FINISHED_RIGHT);
+               result = mathcursor->end(sel) ? DispatchResult(true, true) : DispatchResult(false, FINISHED_RIGHT);
                break;
 
        case LFUN_PRIORSEL:
@@ -669,7 +669,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                if (!argument.empty()) {
                        recordUndo(bv, Undo::ATOMIC);
                        if (argument.size() == 1)
-                               result = mathcursor->interpret(argument[0]) ? DispatchResult(true) : DispatchResult(false, FINISHED_RIGHT);
+                               result = mathcursor->interpret(argument[0]) ? DispatchResult(true, true) : DispatchResult(false, FINISHED_RIGHT);
                        else
                                mathcursor->insert(argument);
                }
@@ -718,7 +718,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                        MathArray ar;
                        if (createMathInset_fromDialogStr(cmd.argument, ar)) {
                                mathcursor->insert(ar);
-                               result = DispatchResult(true);
+                               result = DispatchResult(true, true);
                        } else {
                                result = DispatchResult(false);
                        }
@@ -730,7 +730,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
                result = DispatchResult(false);
        }
 
-       if (result == DispatchResult(true))
+       if (result == DispatchResult(true, true))
                bv->updateInset(this);
 
        mathcursor->normalize();
@@ -741,7 +741,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
        if (mathcursor->selection() || was_selection)
                toggleInsetSelection(bv);
 
-       if (result.val() <= NOUPDATE) {
+       if (result.dispatched()) {
                fitInsetCursor(bv);
                revealCodes(bv);
                cmd.view()->stuffClipboard(mathcursor->grabSelection());
index a0d8fa6be606d784969e8c5653a691a59f1a9ff2..d16f82776cfd17ed3badbd83fc1ff4662a07013c 100644 (file)
@@ -1050,7 +1050,7 @@ DispatchResult MathGridInset::priv_dispatch(FuncRequest const & cmd,
                case LFUN_MOUSE_RELEASE:
                        //if (cmd.button() == mouse_button::button3) {
                        //      GridInsetMailer(*this).showDialog();
-                       //      return DispatchResult(true);
+                       //      return DispatchResult(true, true);
                        //}
                        return DispatchResult(false);
 
index df370ecffac45bb7af32bab25ea28ec6e672cd66..caf7b2393620ebaef98dcde29ffd0f1252e53f69 100644 (file)
@@ -798,7 +798,7 @@ DispatchResult MathHullInset::priv_dispatch
                                                numbered(row, !old);
                                //bv->owner()->message(old ? _("No number") : _("Number"));
                        }
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_MATH_NONUMBER:
                        if (display()) {
@@ -808,7 +808,7 @@ DispatchResult MathHullInset::priv_dispatch
                                //bv->owner()->message(old ? _("No number") : _("Number"));
                                numbered(r, !old);
                        }
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
 
                case LFUN_INSERT_LABEL: {
                        row_type r = (type_ == "multline") ? nrows() - 1 : row(idx);
@@ -832,7 +832,7 @@ DispatchResult MathHullInset::priv_dispatch
                        if (!new_label.empty())
                                numbered(r, true);
                        label(r, new_label);
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
 
                case LFUN_MATH_EXTERN:
index c561af8e8ffbf706f07089eb419dc3d6ad5a882f..9692a0b7f697692e7b2bf53b8df92ef29d14b4ee 100644 (file)
@@ -299,7 +299,7 @@ MathNestInset::priv_dispatch(FuncRequest const & cmd,
                        mathed_parse_cell(ar, cmd.argument);
                        cell(idx).insert(pos, ar);
                        pos += ar.size();
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
 
                case LFUN_PASTESELECTION:
index e60c2dd635c7ea184c04d108315748967f67ac41..3c226e2ab3f04ece5185d0e314c26dd27d669c03 100644 (file)
@@ -528,7 +528,7 @@ MathScriptInset::priv_dispatch(FuncRequest const & cmd,
                        limits_ =  (hasLimits()) ? -1 : 1;
                else
                        limits_ = 0;
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        }
 
        return MathNestInset::priv_dispatch(cmd, idx, pos);
index 89319115a72c6b06e4d069683ff3bca854ca91af..d157c34b75077e520aabb8caaf7497b2adf1b12d 100644 (file)
@@ -66,14 +66,14 @@ RefInset::priv_dispatch(FuncRequest const & cmd,
 
                        *this = *ar[0].nucleus()->asRefInset();
 
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
                break;
        case LFUN_MOUSE_RELEASE:
                if (cmd.button() == mouse_button::button3) {
                        lyxerr << "trying to goto ref" << cell(0) << endl;
                        cmd.view()->dispatch(FuncRequest(LFUN_REF_GOTO, asString(cell(0))));
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
                if (cmd.button() == mouse_button::button1) {
                        // Eventually trigger dialog with button 3
@@ -81,13 +81,13 @@ RefInset::priv_dispatch(FuncRequest const & cmd,
                        string const data = createDialogStr("ref");
                        cmd.view()->owner()->getDialogs().
                                show("ref", data, this);
-                       return DispatchResult(true);
+                       return DispatchResult(true, true);
                }
                break;
        case LFUN_MOUSE_PRESS:
        case LFUN_MOUSE_MOTION:
                // eat other mouse commands
-               return DispatchResult(true);
+               return DispatchResult(true, true);
        default:
                return CommandInset::priv_dispatch(cmd, idx, pos);
        }
index 3585c9c5eaec991156305079093db373e99f5abf..e47e7e4067fdeffc0ca4e99613334e56ec48e42e 100644 (file)
@@ -1537,5 +1537,5 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd)
                return DispatchResult(false);
        }
 
-       return DispatchResult(true);
+       return DispatchResult(true, true);
 }