]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathCases.cpp
... and RELEASE-NOTES
[lyx.git] / src / mathed / InsetMathCases.cpp
index 17b4fb146968aea388ab9023853fd5f5994c6f15..10d889555b91dccc2293424f0673df3a6004f59e 100644 (file)
@@ -71,14 +71,11 @@ void InsetMathCases::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        //lyxerr << "*** InsetMathCases: request: " << cmd << endl;
        switch (cmd.action()) {
-       case LFUN_INSET_MODIFY: {
-               istringstream is(to_utf8(cmd.argument()));
-               string s;
-               is >> s;
-               if (s != "tabular")
-                       break;
-               is >> s;
+       case LFUN_TABULAR_FEATURE: {
+               string s = cmd.getArg(0);
                // vertical lines and adding/deleting columns is not allowed for \cases
+               // FIXME: "I suspect that the break after cur.undispatched() should be a
+               // return; the recordUndo seems bogus too." (lasgouttes)
                if (s == "append-column" || s == "delete-column"
                    || s == "add-vline-left" || s == "add-vline-right") {
                        cur.undispatched();
@@ -97,13 +94,8 @@ bool InsetMathCases::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
        switch (cmd.action()) {
-       case LFUN_INSET_MODIFY: {
-               istringstream is(to_utf8(cmd.argument()));
-               string s;
-               is >> s;
-               if (s != "tabular")
-                       break;
-               is >> s;
+       case LFUN_TABULAR_FEATURE: {
+               string s = cmd.getArg(0);
                if (s == "add-vline-left" || s == "add-vline-right") {
                        flag.setEnabled(false);
                        flag.message(bformat(
@@ -185,11 +177,17 @@ void InsetMathCases::validate(LaTeXFeatures & features) const
        features.require("amsmath");
        InsetMathGrid::validate(features);
        if (features.runparams().math_flavor == OutputParams::MathAsHTML)
-               // CSS based on eLyXer's
+               // CSS based on eLyXer's, with modifications suggested in bug #8755
                features.addCSSSnippet(
-                       "table.cases{display: inline-block; text-align: center;"
+                       "table.cases{display: inline-block; text-align: center; border: none;"
                        "border-left: thin solid black; vertical-align: middle; padding-left: 0.5ex;}\n"
-                       "table.cases td {text-align: left;}");
+                       "table.cases td {text-align: left; border: none;}");
+}
+
+
+int InsetMathCases::displayColSpace(col_type) const
+{
+       return 20;
 }