commit 527cc8ca9c829cbe227667c5c2a57ebce2199606 Author: Guillaume Munch <g...@lyx.org> Date: Sun Feb 5 11:04:41 2017 +0100
Disable InsetMathKern with invalid lengths (#10539) 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 | 2 -- src/mathed/MathParser.cpp | 2 +- 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp index 12817a3..3198f80 100644 --- a/src/mathed/MathFactory.cpp +++ b/src/mathed/MathFactory.cpp @@ -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; diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 83fc9c7..ca2eb0f 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -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))); }