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

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@36527 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-11-26 22:54:32 +00:00
parent 3e722cd656
commit 867fafeaae
2 changed files with 13 additions and 0 deletions

View File

@ -53,6 +53,7 @@
#include "graphics/PreviewImage.h"
#include "graphics/PreviewLoader.h"
#include "frontends/alert.h"
#include "frontends/Painter.h"
#include "support/lassert.h"
@ -1146,6 +1147,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('=')));

View File

@ -56,6 +56,9 @@ What's new
* USER INTERFACE
- Fix crash when using a computer algebra system from within AMS math
environments (bug 7058).
- Fix insertion of a user math macro trough the math-insert lfun when a
selection is present (bug 6939).