]> git.lyx.org Git - features.git/commitdiff
Disable InsetMathKern with invalid lengths (#10539)
authorGuillaume Munch <gm@lyx.org>
Sun, 5 Feb 2017 10:04:41 +0000 (11:04 +0100)
committerGuillaume Munch <gm@lyx.org>
Sat, 11 Feb 2017 20:52:09 +0000 (21:52 +0100)
From now on \kern and \mkern remain as ERT as long as the length is invalid.

Fixes #10539 (regression at 10c8d51b).

The only way to produce an InsetMathKern now is via parsing (i.e. file opening
or copy-paste). This is because there has never been any sensible way to input a
valid InsetMathKern, but this is another issue.

src/mathed/MathFactory.cpp
src/mathed/MathParser.cpp

index 12817a35e48af9c412b7e966f2a44f00abdfa0c5..3198f80de66688c3da5617e6bc7820345906bf46 100644 (file)
@@ -497,8 +497,6 @@ MathAtom createInsetMath(docstring const & s, Buffer * buf)
                return MathAtom(new InsetMathMakebox(buf, true));
        if (s == "makebox")
                return MathAtom(new InsetMathMakebox(buf, false));
-       if (s == "kern" || s == "mkern")
-               return MathAtom(new InsetMathKern);
        if (s.substr(0, 8) == "xymatrix") {
                char spacing_code = '\0';
                Length spacing;
index 83fc9c7da602bfddc31d615bbf9ca92270220a3d..ca2eb0f6e5114ef46a33251d6dabd248505aade8 100644 (file)
@@ -1785,7 +1785,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                        break;
                        }
                        if (s.empty())
-                               cell->push_back(MathAtom(new InsetMathKern));
+                               cell->push_back(MathAtom(new MathMacro(buf, t.cs())));
                        else
                                cell->push_back(MathAtom(new InsetMathKern(s)));
                }