From: André Pönitz Date: Fri, 30 Mar 2007 17:16:26 +0000 (+0000) Subject: fix 3396 X-Git-Tag: 1.6.10~10410 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4ab39351e28efa714c19423286cfc8dee300235e;p=lyx.git fix 3396 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17650 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/MathParser.C b/src/mathed/MathParser.C index e8697a668a..601e59578e 100644 --- a/src/mathed/MathParser.C +++ b/src/mathed/MathParser.C @@ -263,7 +263,7 @@ public: /// Token(char_type c, CatCode cat) : cs_(), char_(c), cat_(cat) {} /// - Token(docstring const & cs) : cs_(cs), char_(0), cat_(catIgnore) {} + explicit Token(docstring const & cs) : cs_(cs), char_(0), cat_(catIgnore) {} /// docstring const & cs() const { return cs_; } @@ -285,6 +285,7 @@ private: CatCode cat_; }; + ostream & operator<<(ostream & os, Token const & t) { if (t.cs().size()) { @@ -297,7 +298,7 @@ ostream & operator<<(ostream & os, Token const & t) // In order to avoid that we return early: if (cs == "\\") return os; - os << '\\' << cs; + os << '\\' << to_utf8(cs); } else if (t.cat() == catLetter) os << t.character(); @@ -1127,6 +1128,8 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, docstring const l = tl.cs() == "|" ? from_ascii("Vert") : tl.asString(); MathArray ar; parse(ar, FLAG_RIGHT, mode); + if (!good()) + break; skipSpaces(); Token const & tr = getToken(); docstring const r = tr.cs() == "|" ? from_ascii("Vert") : tr.asString(); @@ -1239,9 +1242,9 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, parse2(cell->back(), FLAG_END, mode, false); } else { dump(); - lyxerr << "found math environment `" << name + lyxerr << "found math environment `" << to_utf8(name) << "' in symbols file with unsupported inset `" - << l->inset << "'." << endl; + << to_utf8(l->inset) << "'." << endl; // create generic environment inset cell->push_back(MathAtom(new InsetMathEnv(name))); parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode); @@ -1250,7 +1253,8 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags, else { dump(); - lyxerr << "found unknown math environment '" << name << "'" << endl; + lyxerr << "found unknown math environment '" << to_utf8(name) + << "'" << endl; // create generic environment inset cell->push_back(MathAtom(new InsetMathEnv(name))); parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);