]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_hullinset.C
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_hullinset.C
index 47bbd258adb48aca22c946319de77a5710d942d0..092b15decdc6b9b05577072876d7bfab41b37497 100644 (file)
@@ -1096,6 +1096,7 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd,
        case LFUN_MATH_MUTATE:
        case LFUN_MATH_DISPLAY:
                // we handle these
+               flag.enabled(true);
                return true;
        case LFUN_TABULAR_FEATURE: {
                istringstream is(cmd.argument);
@@ -1111,12 +1112,6 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd,
                        flag.enabled(false);
                        return true;
                }
-               if (nrows() <= 1
-                   && (s == "delete-row" || s == "swap-row")) {
-                       flag.message(N_("Only one row"));
-                       flag.enabled(false);
-                       return true;
-               }
                if (!colChangeOK()
                    && (s == "append-column"
                        || s == "delete-column"
@@ -1127,9 +1122,20 @@ bool MathHullInset::getStatus(LCursor & cur, FuncRequest const & cmd,
                        flag.enabled(false);
                        return true;
                }
-               if (ncols() <= 1
-                   && (s == "delete-column" || s == "swap-column")) {
-                       flag.message(N_("Only one column"));
+               if ((type_ == "simple" 
+                 || type_ == "equation" 
+                 || type_ == "none") &&
+                   (s == "add-hline-above" || s == "add-hline-below")) {
+                       flag.message(bformat(
+                               N_("Can't add horizontal grid lines in '%1$s'"),
+                               type_));
+                       flag.enabled(false);
+                       return true;
+               }
+               if (s == "add-vline-left" || s == "add-vline-right") { 
+                       flag.message(bformat(
+                               N_("Can't add vertical grid lines in '%1$s'"),
+                               type_));
                        flag.enabled(false);
                        return true;
                }