From: Jean-Marc Lasgouttes Date: Wed, 7 Nov 2018 18:24:54 +0000 (-1000) Subject: Fixup 097da3a9: update the math parser X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=88278e243ac6570e1e586894fb927f9e6903fe62;p=features.git Fixup 097da3a9: update the math parser One has to account for the change in cell numbering. --- diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 21bdb66dee..2452b6bb45 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -1432,12 +1432,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, parse(ar, FLAG_OPTION, mode); if (!ar.empty()) { cell->push_back(MathAtom(new InsetMathRoot(buf))); - cell->back().nucleus()->cell(0) = ar; - parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode); - } else { + cell->back().nucleus()->cell(1) = ar; + } else cell->push_back(MathAtom(new InsetMathSqrt(buf))); - parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); - } + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); } else if (t.cs() == "cancelto") { @@ -1529,8 +1527,8 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, cell->push_back(MathAtom(new InsetMathStackrel(buf, !ar.empty()))); if (!ar.empty()) cell->back().nucleus()->cell(2) = ar; - parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode); + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); } else if (t.cs() == "xrightarrow" || t.cs() == "xleftarrow") { @@ -2034,6 +2032,12 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, putback(); } + else if (l->inset == "underset" || l->inset == "overset") { + cell->push_back(createInsetMath(t.cs(), buf)); + parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode); + parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); + } + else { MathAtom at = createInsetMath(t.cs(), buf); for (InsetMath::idx_type i = 0; i < at->nargs(); ++i)