From: Jean-Marc Lasgouttes Date: Sun, 23 Jul 2023 15:34:01 +0000 (+0200) Subject: Fix issues with inset-dissolve in mathed X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0f7404392c2c710aa967a937f47eca0ad94cef93;p=features.git Fix issues with inset-dissolve in mathed * do not try to dissolve a macro template inset (avoids a crash) * disable inset-dissolve when an argument is given * when triggered by the AtPoint mechanism, make sur to dissolve the right inset. Fixes bug #12562. --- diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 804ee4d002..8bd05679c3 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1285,7 +1285,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) break; } case LFUN_INSET_DISSOLVE: - if (!asHullInset()) { + if (cmd.argument().empty() && !asHullInset() && !asMacroTemplate()) { + // we have been triggered via the AtPoint mechanism + if (cur.nextInset() == this) + cur.push(*this); cur.recordUndoInset(); cur.pullArg(); } @@ -1528,7 +1531,7 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd, } case LFUN_INSET_DISSOLVE: - flag.setEnabled(!asHullInset()); + flag.setEnabled(cmd.argument().empty() && !asHullInset() && !asMacroTemplate()); break; case LFUN_PASTE: {