// at.nucleus()->cell(0) = ar;
//else
// lyxerr << "unusual contents found: " << ar << endl;
- return false;
- }
- at = ar[0];
- return true;
+ success_ = false;
+ } else
+ at = ar[0];
+ return success_;
}
}
else if (t.cs() == "(") {
+ if (mode == InsetMath::MATH_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullSimple)));
parse2(cell->back(), FLAG_SIMPLE2, InsetMath::MATH_MODE, false);
}
else if (t.cs() == "[") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullEquation)));
parse2(cell->back(), FLAG_EQUATION, InsetMath::MATH_MODE, false);
}
}
else if (name == "math") {
+ if (mode == InsetMath::MATH_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullSimple)));
parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, true);
}
else if (name == "equation" || name == "equation*"
|| name == "displaymath") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullEquation)));
parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, (name == "equation"));
}
else if (name == "eqnarray" || name == "eqnarray*") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullEqnArray)));
parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name));
}
else if (name == "align" || name == "align*") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullAlign)));
parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name));
}
else if (name == "flalign" || name == "flalign*") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullFlAlign)));
parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name));
}
else if (name == "alignat" || name == "alignat*") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
// ignore this for a while
getArg('{', '}');
cell->push_back(MathAtom(new InsetMathHull(hullAlignAt)));
}
else if (name == "xalignat" || name == "xalignat*") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
// ignore this for a while
getArg('{', '}');
cell->push_back(MathAtom(new InsetMathHull(hullXAlignAt)));
}
else if (name == "xxalignat") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
// ignore this for a while
getArg('{', '}');
cell->push_back(MathAtom(new InsetMathHull(hullXXAlignAt)));
}
else if (name == "multline" || name == "multline*") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullMultline)));
parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name));
}
else if (name == "gather" || name == "gather*") {
+ if (mode != InsetMath::UNDECIDED_MODE) {
+ error("bad math environment");
+ break;
+ }
cell->push_back(MathAtom(new InsetMathHull(hullGather)));
parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, !stared(name));
}