+2006-02-13 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * math_macro.C (editXY): Prevent crash (fix by Andrew Beck)
+
2006-01-28 Lars Gullik Bjønnes <larsbj@lyx.org>
* math_hullinset.C (getStatus): get rid of a compiler warning
InsetBase * MathMacro::editXY(LCursor & cur, int x, int y)
{
// We may have 0 arguments, but MathNestInset requires at least one.
- if (nargs() > 0)
+ if (nargs() > 0) {
+ // Prevent crash due to cold coordcache
+ // FIXME: This is only a workaround, the call of
+ // MathNestInset::editXY is correct. The correct fix would
+ // ensure that the coordcache of the arguments is valid.
+ if (!editing(&cur.bv())) {
+ edit(cur, true);
+ return this;
+ }
return MathNestInset::editXY(cur, x, y);
+ }
return this;
}