]> git.lyx.org Git - lyx.git/commitdiff
Cleanup InsetTabular::getStatus
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 9 Mar 2010 23:04:59 +0000 (23:04 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 9 Mar 2010 23:04:59 +0000 (23:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33690 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetTabular.cpp

index a542b8f4b64d5474961d08e846a7839d111cfd52..b623270edb1c3c9ec6acf75a8915271d9ffc5c07 100644 (file)
@@ -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;