commit 974766cd1c90edb7cc70bd0146ee59594aef321a
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Wed Nov 7 08:24:54 2018 -1000

    Fixup 097da3a9: update the math parser
    
    One has to account for the change in cell numbering.
---
 src/mathed/MathParser.cpp |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index 21bdb66..2452b6b 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)

Reply via email to