X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathParser.cpp;h=c3bea0d540e7363c79ed3159d4f4cbe6634be7d0;hb=f96b99dc;hp=56ca6dbe2b8389fff6572c894c12a745b653d410;hpb=1dbc50a30d34c4e394ffad06715a88af444ade62;p=features.git diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 56ca6dbe2b..c3bea0d540 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -797,7 +797,6 @@ void Parser::parse2(MathAtom & at, const unsigned flags, const mode_type mode, bool Parser::parse1(InsetMathGrid & grid, unsigned flags, const mode_type mode, const bool numbered) { - int limits = 0; InsetMathGrid::row_type cellrow = 0; InsetMathGrid::col_type cellcol = 0; MathData * cell = &grid.cell(grid.index(cellrow, cellcol)); @@ -1006,10 +1005,6 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, p->nuc().erase(0); parse(p->cell(p->idxOfScript(up)), FLAG_ITEM, mode); - if (limits) { - p->limits(limits); - limits = 0; - } } else if (t.character() == ']' && (flags & FLAG_BRACK_LAST)) { @@ -1408,9 +1403,8 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags, } else if (t.cs() == "limits" || t.cs() == "nolimits") { - CatCode const cat = nextToken().cat(); - if (cat == catSuper || cat == catSub) - limits = t.cs() == "limits" ? 1 : -1; + if (!cell->empty()) + cell->back()->limits(t.cs() == "limits" ? LIMITS : NO_LIMITS); else { MathAtom at = createInsetMath(t.cs(), buf); cell->push_back(at);