]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.cpp
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathGrid.cpp
index 4e029097e8703e0ab6684fddd1106d3e003b38b4..61e13dfe8c0904839ad562563138a05d8cc9b6bd 100644 (file)
@@ -1405,8 +1405,18 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
                }
                if (s == "valign-top" || s == "valign-middle" ||
                    s == "valign-bottom" || s == "align-left" ||
-                   s == "align-right" || s == "align-center" ||
-                   s == "append-row" || s == "delete-row" ||
+                   s == "align-right" || s == "align-center") {
+                       status.setEnabled(true);
+                       char const ha = horizontalAlignment(cur.col());
+                       char const va = verticalAlignment();
+                       status.setOnOff((s == "align-left" && ha == 'l')
+                                       || (s == "align-right"   && ha == 'r')
+                                       || (s == "align-center"  && ha == 'c')
+                                       || (s == "valign-top"    && va == 't')
+                                       || (s == "valign-bottom" && va == 'b')
+                                       || (s == "valign-middle" && va == 'm'));
+               }
+               if (s == "append-row" || s == "delete-row" ||
                    s == "copy-row" || s == "swap-row" ||
                    s == "add-hline-above" || s == "add-hline-below" ||
                    s == "delete-hline-above" || s == "delete-hline-below" ||
@@ -1421,15 +1431,6 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
                                from_utf8(N_("Unknown tabular feature '%1$s'")), lyx::from_ascii(s)));
                }
 
-               char const ha = horizontalAlignment(cur.col());
-               char const va = verticalAlignment();
-               status.setOnOff((s == "align-left" && ha == 'l')
-                          || (s == "align-right"   && ha == 'r')
-                          || (s == "align-center"  && ha == 'c')
-                          || (s == "valign-top"    && va == 't')
-                          || (s == "valign-bottom" && va == 'b')
-                          || (s == "valign-middle" && va == 'm'));
-
 #if 0
                // FIXME: What did this code do?
                // Please check whether it is still needed!