From d43cdfa5ef6c17ff39e9c471cc06597e6354fba8 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Tue, 23 Nov 2010 15:36:58 +0000 Subject: [PATCH] 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 --- src/mathed/InsetMathHull.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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('='))); -- 2.39.2