From 974766cd1c90edb7cc70bd0146ee59594aef321a Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 7 Nov 2018 08:24:54 -1000 Subject: [PATCH] Fixup 097da3a9: update the math parser One has to account for the change in cell numbering. --- src/mathed/MathParser.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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) -- 2.39.2