]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathParser.cpp
Preserve \inputencoding value when switching to non-TeX fonts.
[lyx.git] / src / mathed / MathParser.cpp
index f0d1d7c5359971c46c995522f5769ce38262c7f4..3449cff5ac426fe85eb8f5750a716e68a6314878 100644 (file)
@@ -946,7 +946,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                        parse(ar, FLAG_BRACE_LAST, mode);
                        // do not create a BraceInset if they were written by LyX
                        // this helps to keep the annoyance of  "a choose b"  to a minimum
-                       if (ar.size() == 1 && (ar[0]->extraBraces() || ar[0]->asBraceInset()))
+                       if (ar.size() == 1 && ar[0]->extraBraces())
                                cell->append(ar);
                        else
                                cell->push_back(MathAtom(new InsetMathBrace(ar)));
@@ -1604,7 +1604,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                docstring const halign = parse_verbatim_item();
                                cell->push_back(MathAtom(new InsetMathArray(buf, name,
                                        InsetMathGrid::guessColumns(halign), 1, (char)valign[0], halign)));
-                               parse2(cell->back(), FLAG_END, mode, false);
+                               parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, false);
                        }
 
                        else if (name == "tabular") {
@@ -2081,7 +2081,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                                        Encodings::MATH_CMD | Encodings::TEXT_CMD,
                                                        is_combining, termination);
                                        }
-                                       if (c) {
+                                       if (c && buf->params().encoding().encodable(c)) {
                                                if (termination) {
                                                        if (nextToken().cat() == catBegin) {
                                                                getToken();