From: Enrico Forestieri Date: Tue, 23 Nov 2010 15:36:58 +0000 (+0000) Subject: Fix bug #7058 (Crash when invoking CAS on a multiline AMS context) X-Git-Tag: 2.0.0~1724 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d43cdfa5ef6c17ff39e9c471cc06597e6354fba8;p=features.git 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 --- diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index f5e44f005e..c53988c996 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -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('=')));