// look if there is no other macro in edit mode above
++i;
for (; i != cur.depth(); ++i) {
- MathMacro const * macro = dynamic_cast<MathMacro const *>(&cur[i].inset());
- if (macro && macro->displayMode() == DISPLAY_NORMAL)
- return false;
+ InsetMath * im = cur[i].asInsetMath();
+ if (im) {
+ MathMacro const * macro = im->asMacro();
+ if (macro && macro->displayMode() == DISPLAY_NORMAL)
+ return false;
+ }
}
// ok, none found, I am the highest one
inset_cursor.cell().erase(inset_cursor.pos());
inset_cursor.cell().insert(inset_cursor.pos(),
createInsetMath(unfolded_name, cur.buffer()));
+ cur.resetAnchor();
cur.screenUpdateFlags(cur.result().screenUpdate() | Update::SinglePar);
return true;
}