This patch (for 1.4, but I guess it applies also to trunk) fixes bug 2789
for me (see http://bugzilla.lyx.org/show_bug.cgi?id=2789).
Please test.
Georg
Index: src/mathed/math_hullinset.C
===================================================================
--- src/mathed/math_hullinset.C (Revision 14937)
+++ src/mathed/math_hullinset.C (Arbeitskopie)
@@ -1067,28 +1067,19 @@ void MathHullInset::doDispatch(LCursor &
case LFUN_INSET_INSERT: {
//lyxerr << "arg: " << cmd.argument << endl;
string const name = cmd.getArg(0);
- if (name == "label") {
- InsetCommandParams p;
- InsetCommandMailer::string2params(name, cmd.argument, p);
- string str = p.getContents();
- recordUndoInset(cur);
- row_type const r = (type_ == "multline") ? nrows() - 1 : cur.row();
- str = lyx::support::trim(str);
- if (!str.empty())
- numbered(r, true);
- string old = label(r);
- if (str != old) {
- cur.bv().buffer()->changeRefsIfUnique(old, str);
- label(r, str);
- }
- break;
+ InsetCommandParams p;
+ InsetCommandMailer::string2params(name, cmd.argument, p);
+ string str = p.getContents();
+ recordUndoInset(cur);
+ row_type const r = (type_ == "multline") ? nrows() - 1 : cur.row();
+ str = lyx::support::trim(str);
+ if (!str.empty())
+ numbered(r, true);
+ string old = label(r);
+ if (str != old) {
+ cur.bv().buffer()->changeRefsIfUnique(old, str);
+ label(r, str);
}
- MathArray ar;
- if (createMathInset_fromDialogStr(cmd.argument, ar)) {
- recordUndo(cur);
- cur.insert(ar);
- } else
- cur.undispatched();
break;
}
@@ -1151,15 +1142,11 @@ bool MathHullInset::getStatus(LCursor &
case LFUN_INSERT_LABEL:
status.enabled(type_ != "simple");
return true;
- case LFUN_INSET_INSERT: {
- // Don't test createMathInset_fromDialogStr(), since
- // getStatus is not called with a valid reference and the
- // dialog would not be applyable.
- string const name = cmd.getArg(0);
- status.enabled(name == "ref" ||
- (name == "label" && type_ != "simple"));
+ case LFUN_INSET_INSERT:
+ if (cmd.getArg(0) != "label")
+ return MathGridInset::getStatus(cur, cmd, status);
+ status.enabled(type_ != "simple");
break;
- }
case LFUN_TABULAR_FEATURE: {
istringstream is(cmd.argument);
string s;
Index: src/mathed/math_nestinset.C
===================================================================
--- src/mathed/math_nestinset.C (Revision 14937)
+++ src/mathed/math_nestinset.C (Arbeitskopie)
@@ -902,6 +906,16 @@ void MathNestInset::doDispatch(LCursor &
break;
}
+ case LFUN_INSET_INSERT: {
+ MathArray ar;
+ if (createMathInset_fromDialogStr(cmd.argument, ar)) {
+ recordUndo(cur);
+ cur.insert(ar);
+ } else
+ cur.undispatched();
+ break;
+ }
+
default:
MathDimInset::doDispatch(cur, cmd);
break;
@@ -985,6 +1000,16 @@ bool MathNestInset::getStatus(LCursor &
case LFUN_INSERT_MATRIX:
flag.enabled(currentMode() == MATH_MODE);
break;
+
+ case LFUN_INSET_INSERT: {
+ // Don't test createMathInset_fromDialogStr(), since
+ // getStatus is not called with a valid reference and the
+ // dialog would not be applyable.
+ string const name = cmd.getArg(0);
+ flag.enabled(name == "ref");
+ break;
+ }
+
default:
ret = false;
break;