Fix bug #7058 (Crash when invoking CAS on a multiline AMS context)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36447 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-11-23 15:36:58 +00:00
parent 79514a3fcd
commit d43cdfa5ef

View File

@ -43,6 +43,7 @@
#include "graphics/PreviewImage.h"
#include "graphics/PreviewLoader.h"
#include "frontends/alert.h"
#include "frontends/Painter.h"
#include "support/lassert.h"
@ -1195,6 +1196,15 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
// return;
//}
// only inline, display or eqnarray math is allowed
if (getType() > hullEqnArray) {
frontend::Alert::warning(_("Bad math environment"),
_("Computation cannot be performed for AMS "
"math environments.\nChange the math "
"formula type and try again."));
return;
}
MathData eq;
eq.push_back(MathAtom(new InsetMathChar('=')));