Fix bug #6564. The cmd status retrieval is quite broken within tables (math or text).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33639 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-03-06 14:19:21 +00:00
parent 27fd444678
commit 321f6031af

View File

@ -1407,8 +1407,17 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
istringstream is(to_utf8(cmd.argument()));
string s;
is >> s;
if (s != "tabular")
return InsetMathNest::getStatus(cur, cmd, status);
if (s != "tabular") {
// We only now about table actions here.
break;
}
if (&cur.inset() != this) {
// Table actions requires that the cursor is _inside_ the
// table.
status.setEnabled(false);
status.message(from_utf8(N_("Cursor not in table")));
return true;
}
is >> s;
if (nrows() <= 1 && (s == "delete-row" || s == "swap-row")) {
status.setEnabled(false);
@ -1499,8 +1508,9 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
return true;
default:
return InsetMathNest::getStatus(cur, cmd, status);
break;
}
return InsetMathNest::getStatus(cur, cmd, status);
}