]> git.lyx.org Git - features.git/commitdiff
Fix bug #7058 (Crash when invoking CAS on a multiline AMS context)
authorEnrico Forestieri <forenr@lyx.org>
Tue, 23 Nov 2010 15:36:58 +0000 (15:36 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 23 Nov 2010 15:36:58 +0000 (15:36 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36447 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathHull.cpp

index f5e44f005e7c2e3f983f65bb797daf9f9414a7c0..c53988c9969efe322365768e454d7a3655f975b4 100644 (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('=')));