Don't create nested math hulls (fixes bug #5392).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29599 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-05-09 21:15:36 +00:00
parent b946e2209a
commit 318fad58a6

View File

@ -46,6 +46,7 @@ following hack as starting point to write some macros:
#include "InsetMathColor.h" #include "InsetMathColor.h"
#include "InsetMathComment.h" #include "InsetMathComment.h"
#include "InsetMathDelim.h" #include "InsetMathDelim.h"
#include "InsetMathEnsureMath.h"
#include "InsetMathEnv.h" #include "InsetMathEnv.h"
#include "InsetMathFrac.h" #include "InsetMathFrac.h"
#include "InsetMathKern.h" #include "InsetMathKern.h"
@ -804,8 +805,14 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
} else { } else {
// simple $...$ stuff // simple $...$ stuff
putback(); putback();
if (mode == InsetMath::UNDECIDED_MODE) {
cell->push_back(MathAtom(new InsetMathHull(hullSimple))); cell->push_back(MathAtom(new InsetMathHull(hullSimple)));
parse2(cell->back(), FLAG_SIMPLE, InsetMath::MATH_MODE, false); parse2(cell->back(), FLAG_SIMPLE, InsetMath::MATH_MODE, false);
} else {
// Don't create nested math hulls (bug #5392)
cell->push_back(MathAtom(new InsetMathEnsureMath));
parse(cell->back().nucleus()->cell(0), FLAG_SIMPLE, InsetMath::MATH_MODE);
}
} }
} }