From: Abdelrazak Younes Date: Sat, 6 Mar 2010 14:19:21 +0000 (+0000) Subject: Fix bug #6564. The cmd status retrieval is quite broken within tables (math or text). X-Git-Tag: 2.0.0~3897 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=321f6031afc82fe03a00d4b188274940dda5d7ac;p=lyx.git 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 --- diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index a21c2f61e0..7ce5858145 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -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); }