From: Jean-Marc Lasgouttes Date: Tue, 9 Mar 2010 23:04:59 +0000 (+0000) Subject: Cleanup InsetTabular::getStatus X-Git-Tag: 2.0.0~3850 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b8bbd7aea925671c2d57732951270bff03e5c3bf;p=features.git Cleanup InsetTabular::getStatus git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33690 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index a542b8f4b6..b623270edb 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3971,21 +3971,15 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, { switch (cmd.action) { case LFUN_INSET_MODIFY: { - istringstream is(to_utf8(cmd.argument())); - string s; - is >> s; - if (&cur.inset() != this || insetCode(s) != TABULAR_CODE) { - status.clear(); - status.setEnabled(false); + if (&cur.inset() != this || cmd.getArg(0) != "tabular") break; - } - is >> s; + + string const s = cmd.getArg(1); // FIXME: We only check for the very first argument... int action = Tabular::LAST_ACTION; int i = 0; for (; tabularFeature[i].action != Tabular::LAST_ACTION; ++i) { - string const tmp = tabularFeature[i].feature; - if (tmp == s.substr(0, tmp.length())) { + if (tabularFeature[i].feature == s) { action = tabularFeature[i].action; break; } @@ -3996,8 +3990,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, return true; } - string const argument - = ltrim(s.substr(tabularFeature[i].feature.length())); + string const argument = cmd.getLongArg(2); row_type sel_row_start = 0; row_type sel_row_end = 0;