[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| Trying to move along...

Rediffed dispatch-7.diff

Unless someone object this will go in.
(I am not finished, neither cleanup wise nor otherwise...)

? Config
? dispatch-4.diff
? dispatch-5.diff
? dispatch-6.diff
? dispatch-7.diff
? doit.sh
? src/doit.sh
? src/insets/doit.sh
? src/mathed/doit.sh
Index: src/cursor.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
retrieving revision 1.9
diff -u -p -r1.9 cursor.C
--- src/cursor.C	1 Nov 2003 15:45:14 -0000	1.9
+++ src/cursor.C	3 Nov 2003 18:16:17 -0000
@@ -32,12 +32,8 @@ DispatchResult Cursor::dispatch(FuncRequ
 		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: src/dispatchresult.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dispatchresult.h,v
retrieving revision 1.5
diff -u -p -r1.5 dispatchresult.h
--- src/dispatchresult.h	1 Nov 2003 15:45:14 -0000	1.5
+++ src/dispatchresult.h	3 Nov 2003 18:16:17 -0000
@@ -30,13 +30,13 @@
 */
 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: src/lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.530
diff -u -p -r1.530 lyxfunc.C
--- src/lyxfunc.C	1 Nov 2003 15:45:14 -0000	1.530
+++ src/lyxfunc.C	3 Nov 2003 18:16:17 -0000
@@ -885,11 +885,17 @@ void LyXFunc::dispatch(FuncRequest const
 	{
 		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
 			// 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: src/text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.166
diff -u -p -r1.166 text3.C
--- src/text3.C	1 Nov 2003 15:45:14 -0000	1.166
+++ src/text3.C	3 Nov 2003 18:16:18 -0000
@@ -1537,5 +1537,5 @@ DispatchResult LyXText::dispatch(FuncReq
 		return DispatchResult(false);
 	}
 
-	return DispatchResult(true);
+	return DispatchResult(true, true);
 }
Index: src/insets/insetbibitem.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v
retrieving revision 1.38
diff -u -p -r1.38 insetbibitem.C
--- src/insets/insetbibitem.C	3 Nov 2003 17:47:24 -0000	1.38
+++ src/insets/insetbibitem.C	3 Nov 2003 18:16:18 -0000
@@ -67,17 +67,17 @@ InsetBibitem::priv_dispatch(FuncRequest 
 
 	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: src/insets/insetbibtex.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibtex.C,v
retrieving revision 1.37
diff -u -p -r1.37 insetbibtex.C
--- src/insets/insetbibtex.C	1 Nov 2003 15:45:15 -0000	1.37
+++ src/insets/insetbibtex.C	3 Nov 2003 18:16:18 -0000
@@ -92,30 +92,39 @@ 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
 {
Index: src/insets/insetbox.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbox.C,v
retrieving revision 1.7
diff -u -p -r1.7 insetbox.C
--- src/insets/insetbox.C	1 Nov 2003 15:45:15 -0000	1.7
+++ src/insets/insetbox.C	3 Nov 2003 18:16:18 -0000
@@ -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 cons
 		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 cons
 		// fallthrough:
 
 	default:
-		return InsetCollapsable::priv_dispatch(cmd, idx, pos);
+		result = InsetCollapsable::priv_dispatch(cmd, idx, pos);
+		break;
 	}
+	
+	return result;
 }
 
 
Index: src/insets/insetbranch.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbranch.C,v
retrieving revision 1.27
diff -u -p -r1.27 insetbranch.C
--- src/insets/insetbranch.C	1 Nov 2003 15:45:15 -0000	1.27
+++ src/insets/insetbranch.C	3 Nov 2003 18:16:18 -0000
@@ -123,23 +123,23 @@ InsetBranch::priv_dispatch(FuncRequest c
 {
 	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: src/insets/insetcite.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.C,v
retrieving revision 1.70
diff -u -p -r1.70 insetcite.C
--- src/insets/insetcite.C	1 Nov 2003 15:45:15 -0000	1.70
+++ src/insets/insetcite.C	3 Nov 2003 18:16:18 -0000
@@ -316,7 +316,7 @@ InsetCitation::priv_dispatch(FuncRequest
 	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: src/insets/insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.191
diff -u -p -r1.191 insetcollapsable.C
--- src/insets/insetcollapsable.C	3 Nov 2003 16:46:42 -0000	1.191
+++ src/insets/insetcollapsable.C	3 Nov 2003 18:16:19 -0000
@@ -234,7 +234,7 @@ void InsetCollapsable::lfunMouseRelease(
 		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(FuncRequ
 					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(FuncRequ
 				// 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(FuncRequ
 				} 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: src/insets/insetcommand.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.C,v
retrieving revision 1.98
diff -u -p -r1.98 insetcommand.C
--- src/insets/insetcommand.C	1 Nov 2003 15:45:15 -0000	1.98
+++ src/insets/insetcommand.C	3 Nov 2003 18:16:19 -0000
@@ -100,12 +100,12 @@ InsetCommand::priv_dispatch(FuncRequest 
 
 		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: src/insets/insetert.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v
retrieving revision 1.166
diff -u -p -r1.166 insetert.C
--- src/insets/insetert.C	1 Nov 2003 15:45:15 -0000	1.166
+++ src/insets/insetert.C	3 Nov 2003 18:16:19 -0000
@@ -466,28 +466,28 @@ InsetERT::priv_dispatch(FuncRequest cons
 		 */
 		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: src/insets/insetexternal.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.C,v
retrieving revision 1.129
diff -u -p -r1.129 insetexternal.C
--- src/insets/insetexternal.C	3 Nov 2003 17:47:24 -0000	1.129
+++ src/insets/insetexternal.C	3 Nov 2003 18:16:19 -0000
@@ -439,7 +439,7 @@ InsetExternal::priv_dispatch(FuncRequest
 		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
 		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: src/insets/insetfloat.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.C,v
retrieving revision 1.109
diff -u -p -r1.109 insetfloat.C
--- src/insets/insetfloat.C	1 Nov 2003 15:45:15 -0000	1.109
+++ src/insets/insetfloat.C	3 Nov 2003 18:16:19 -0000
@@ -176,12 +176,12 @@ InsetFloat::priv_dispatch(FuncRequest co
 
 		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: src/insets/insetfloatlist.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloatlist.C,v
retrieving revision 1.52
diff -u -p -r1.52 insetfloatlist.C
--- src/insets/insetfloatlist.C	1 Nov 2003 15:45:15 -0000	1.52
+++ src/insets/insetfloatlist.C	3 Nov 2003 18:16:19 -0000
@@ -127,11 +127,11 @@ InsetFloatList::priv_dispatch(FuncReques
 		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: src/insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.225
diff -u -p -r1.225 insetgraphics.C
--- src/insets/insetgraphics.C	1 Nov 2003 15:45:15 -0000	1.225
+++ src/insets/insetgraphics.C	3 Nov 2003 18:16:19 -0000
@@ -203,17 +203,17 @@ InsetGraphics::priv_dispatch(FuncRequest
 			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: src/insets/insetinclude.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v
retrieving revision 1.172
diff -u -p -r1.172 insetinclude.C
--- src/insets/insetinclude.C	3 Nov 2003 17:47:24 -0000	1.172
+++ src/insets/insetinclude.C	3 Nov 2003 18:16:20 -0000
@@ -120,21 +120,21 @@ InsetInclude::priv_dispatch(FuncRequest 
 			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: src/insets/insetindex.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetindex.C,v
retrieving revision 1.54
diff -u -p -r1.54 insetindex.C
--- src/insets/insetindex.C	1 Nov 2003 15:45:16 -0000	1.54
+++ src/insets/insetindex.C	3 Nov 2003 18:16:20 -0000
@@ -68,7 +68,7 @@ InsetIndex::priv_dispatch(FuncRequest co
 	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: src/insets/insetlabel.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlabel.C,v
retrieving revision 1.82
diff -u -p -r1.82 insetlabel.C
--- src/insets/insetlabel.C	1 Nov 2003 15:45:16 -0000	1.82
+++ src/insets/insetlabel.C	3 Nov 2003 18:16:20 -0000
@@ -68,7 +68,7 @@ InsetLabel::priv_dispatch(FuncRequest co
 
 	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 co
 
 		setParams(p);
 		bv->updateInset(this);
-		return DispatchResult(true);
+		return DispatchResult(true, true);
 	}
 
 	default:
Index: src/insets/insetminipage.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.102
diff -u -p -r1.102 insetminipage.C
--- src/insets/insetminipage.C	1 Nov 2003 15:45:16 -0000	1.102
+++ src/insets/insetminipage.C	3 Nov 2003 18:16:20 -0000
@@ -112,12 +112,12 @@ InsetMinipage::priv_dispatch(FuncRequest
 		 * 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: src/insets/insetnote.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.C,v
retrieving revision 1.61
diff -u -p -r1.61 insetnote.C
--- src/insets/insetnote.C	1 Nov 2003 15:45:16 -0000	1.61
+++ src/insets/insetnote.C	3 Nov 2003 18:16:20 -0000
@@ -142,7 +142,7 @@ InsetNote::priv_dispatch(FuncRequest con
 		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 con
 
 	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: src/insets/insetref.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.C,v
retrieving revision 1.79
diff -u -p -r1.79 insetref.C
--- src/insets/insetref.C	1 Nov 2003 15:45:16 -0000	1.79
+++ src/insets/insetref.C	3 Nov 2003 18:16:20 -0000
@@ -58,7 +58,7 @@ InsetRef::priv_dispatch(FuncRequest cons
 				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: src/insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.363
diff -u -p -r1.363 insettabular.C
--- src/insets/insettabular.C	3 Nov 2003 17:47:25 -0000	1.363
+++ src/insets/insettabular.C	3 Nov 2003 18:16:21 -0000
@@ -677,7 +677,7 @@ InsetTabular::priv_dispatch(FuncRequest 
 
 		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 
 				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 
 
 	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 
 			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 
 	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 
 		}
 	}
 
-	result = DispatchResult(true);
+	result = DispatchResult(true, true);
 	switch (action) {
 		// --- Cursor Movements ----------------------------------
 	case LFUN_RIGHTSEL: {
@@ -1088,7 +1088,7 @@ InsetTabular::priv_dispatch(FuncRequest 
 			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(B
 {
 	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(Bu
 		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(Buff
 			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(Bu
 			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: src/insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.523
diff -u -p -r1.523 insettext.C
--- src/insets/insettext.C	3 Nov 2003 17:47:26 -0000	1.523
+++ src/insets/insettext.C	3 Nov 2003 18:16:21 -0000
@@ -549,7 +549,7 @@ bool InsetText::lfunMouseRelease(FuncReq
 	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(FuncReq
 	// 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 con
 
 		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 con
 		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 con
 
 	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 con
 			}
 			break;
 		default:
-			result = DispatchResult(true);
+			result = DispatchResult(true, true);
 			break;
 		}
 		the_locking_inset = 0;
@@ -752,7 +754,7 @@ InsetText::priv_dispatch(FuncRequest con
 		}
 		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 con
 		else {
 			text_.cursorPrevious();
 			text_.clearSelection();
-			result = DispatchResult(true, NOUPDATE);
+			result = DispatchResult(true);
 		}
 		break;
 
@@ -790,7 +792,7 @@ InsetText::priv_dispatch(FuncRequest con
 		else {
 			text_.cursorNext();
 			text_.clearSelection();
-			result = DispatchResult(true, NOUPDATE);
+			result = DispatchResult(true);
 		}
 		break;
 
@@ -835,7 +837,7 @@ InsetText::priv_dispatch(FuncRequest con
 
 	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 con
 
 	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 con
 
 	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 con
 	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 * 
 	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 * b
 	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(BufferV
 		return DispatchResult(false, FINISHED_UP);
 	text_.cursorUp(bv);
 	text_.clearSelection();
-	return DispatchResult(true, NOUPDATE);
+	return DispatchResult(true);
 }
 
 
@@ -1088,7 +1090,7 @@ DispatchResult InsetText::moveDown(Buffe
 		return DispatchResult(false, FINISHED_DOWN);
 	text_.cursorDown(bv);
 	text_.clearSelection();
-	return DispatchResult(true, NOUPDATE);
+	return DispatchResult(true);
 }
 
 
Index: src/insets/insettoc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettoc.C,v
retrieving revision 1.62
diff -u -p -r1.62 insettoc.C
--- src/insets/insettoc.C	1 Nov 2003 15:45:17 -0000	1.62
+++ src/insets/insettoc.C	3 Nov 2003 18:16:21 -0000
@@ -82,11 +82,11 @@ InsetTOC::priv_dispatch(FuncRequest cons
 	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: src/insets/inseturl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inseturl.C,v
retrieving revision 1.71
diff -u -p -r1.71 inseturl.C
--- src/insets/inseturl.C	1 Nov 2003 15:45:17 -0000	1.71
+++ src/insets/inseturl.C	3 Nov 2003 18:16:21 -0000
@@ -51,7 +51,7 @@ InsetUrl::priv_dispatch(FuncRequest cons
 	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: src/insets/insetwrap.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.C,v
retrieving revision 1.52
diff -u -p -r1.52 insetwrap.C
--- src/insets/insetwrap.C	1 Nov 2003 15:45:17 -0000	1.52
+++ src/insets/insetwrap.C	3 Nov 2003 18:16:21 -0000
@@ -98,12 +98,12 @@ InsetWrap::priv_dispatch(FuncRequest con
 		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: src/insets/updatableinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/updatableinset.C,v
retrieving revision 1.31
diff -u -p -r1.31 updatableinset.C
--- src/insets/updatableinset.C	1 Nov 2003 15:45:17 -0000	1.31
+++ src/insets/updatableinset.C	3 Nov 2003 18:16:21 -0000
@@ -125,7 +125,7 @@ UpdatableInset::priv_dispatch(FuncReques
 		}
 		ev.view()->updateInset(this);
 
-		return DispatchResult(true);
+		return DispatchResult(true, true);
 	}
 	return DispatchResult(false);
 }
Index: src/mathed/formulabase.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.305
diff -u -p -r1.305 formulabase.C
--- src/mathed/formulabase.C	1 Nov 2003 15:45:18 -0000	1.305
+++ src/mathed/formulabase.C	3 Nov 2003 18:16:21 -0000
@@ -228,7 +228,7 @@ DispatchResult InsetFormulaBase::lfunMou
 			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::lfunMou
 		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::lfunMou
 		//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::lfunMou
 
 	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::lfunMou
 		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::lfunMou
 	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(FuncRequ
 			// 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(FuncRequ
 	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(FuncRequ
 	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(FuncRequ
 		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(FuncRequ
 		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(FuncRequ
 		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(FuncRequ
 			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(FuncRequ
 		result = DispatchResult(false);
 	}
 
-	if (result == DispatchResult(true))
+	if (result == DispatchResult(true, true))
 		bv->updateInset(this);
 
 	mathcursor->normalize();
@@ -741,7 +741,7 @@ InsetFormulaBase::priv_dispatch(FuncRequ
 	if (mathcursor->selection() || was_selection)
 		toggleInsetSelection(bv);
 
-	if (result.val() <= NOUPDATE) {
+	if (result.dispatched()) {
 		fitInsetCursor(bv);
 		revealCodes(bv);
 		cmd.view()->stuffClipboard(mathcursor->grabSelection());
Index: src/mathed/math_gridinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.C,v
retrieving revision 1.131
diff -u -p -r1.131 math_gridinset.C
--- src/mathed/math_gridinset.C	1 Nov 2003 15:45:19 -0000	1.131
+++ src/mathed/math_gridinset.C	3 Nov 2003 18:16:22 -0000
@@ -1050,7 +1050,7 @@ DispatchResult MathGridInset::priv_dispa
 		case LFUN_MOUSE_RELEASE:
 			//if (cmd.button() == mouse_button::button3) {
 			//	GridInsetMailer(*this).showDialog();
-			//	return DispatchResult(true);
+			//	return DispatchResult(true, true);
 			//}
 			return DispatchResult(false);
 
Index: src/mathed/math_hullinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_hullinset.C,v
retrieving revision 1.102
diff -u -p -r1.102 math_hullinset.C
--- src/mathed/math_hullinset.C	1 Nov 2003 15:45:19 -0000	1.102
+++ src/mathed/math_hullinset.C	3 Nov 2003 18:16:22 -0000
@@ -798,7 +798,7 @@ DispatchResult MathHullInset::priv_dispa
 						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_dispa
 				//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_dispa
 			if (!new_label.empty())
 				numbered(r, true);
 			label(r, new_label);
-			return DispatchResult(true);
+			return DispatchResult(true, true);
 		}
 
 		case LFUN_MATH_EXTERN:
Index: src/mathed/math_nestinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_nestinset.C,v
retrieving revision 1.76
diff -u -p -r1.76 math_nestinset.C
--- src/mathed/math_nestinset.C	1 Nov 2003 15:45:19 -0000	1.76
+++ src/mathed/math_nestinset.C	3 Nov 2003 18:16:22 -0000
@@ -299,7 +299,7 @@ MathNestInset::priv_dispatch(FuncRequest
 			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: src/mathed/math_scriptinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_scriptinset.C,v
retrieving revision 1.99
diff -u -p -r1.99 math_scriptinset.C
--- src/mathed/math_scriptinset.C	1 Nov 2003 15:45:19 -0000	1.99
+++ src/mathed/math_scriptinset.C	3 Nov 2003 18:16:22 -0000
@@ -528,7 +528,7 @@ MathScriptInset::priv_dispatch(FuncReque
 			limits_ =  (hasLimits()) ? -1 : 1;
 		else
 			limits_ = 0;
-		return DispatchResult(true);
+		return DispatchResult(true, true);
 	}
 
 	return MathNestInset::priv_dispatch(cmd, idx, pos);
Index: src/mathed/ref_inset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ref_inset.C,v
retrieving revision 1.37
diff -u -p -r1.37 ref_inset.C
--- src/mathed/ref_inset.C	1 Nov 2003 15:45:19 -0000	1.37
+++ src/mathed/ref_inset.C	3 Nov 2003 18:16:22 -0000
@@ -66,14 +66,14 @@ RefInset::priv_dispatch(FuncRequest cons
 
 			*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 cons
 			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);
 	}
-- 
        Lgb

Reply via email to