]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathNest.C
* InsetMathNest.C (handleFont): avoid crash on undo when
[features.git] / src / mathed / InsetMathNest.C
index b9b29db0ecc6ea68d960d2407b67bed3f3c78309..367b4a65b743a143ad3eddb5e0ad90d01d7bbe63 100644 (file)
@@ -401,11 +401,12 @@ void InsetMathNest::handleFont
 {
        // this whole function is a hack and won't work for incremental font
        // changes...
-       recordUndo(cur, Undo::ATOMIC);
 
-       if (cur.inset().asInsetMath()->name() == font)
+       if (cur.inset().asInsetMath()->name() == font) {
+               recordUndoInset(cur, Undo::ATOMIC);
                cur.handleFont(to_utf8(font));
-       else {
+       } else {
+               recordUndo(cur, Undo::ATOMIC);
                cur.handleNest(createInsetMath(font));
                cur.insert(arg);
        }