diff --git a/src/Text3.cpp b/src/Text3.cpp index b9d6c591fd..c7ace8143a 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -143,18 +143,22 @@ namespace { #endif cur.insert(new InsetMathHull(hullSimple)); BOOST_ASSERT(old_pos == cur.pos()); - cur.nextInset()->edit(cur, true); + Inset * inset = cur.nextInset(); + inset->edit(cur, true); // don't do that also for LFUN_MATH_MODE // unless you want end up with always changing // to mathrm when opening an inlined inset -- // I really hate "LyXfunc overloading"... - if (display) - cur.dispatch(FuncRequest(LFUN_MATH_DISPLAY)); + if (display) { + FuncRequest cmdm(LFUN_MATH_DISPLAY); + inset->dispatch(cur, cmdm); + } // Avoid an unnecessary undo step if cmd.argument // is empty - if (!cmd.argument().empty()) - cur.dispatch(FuncRequest(LFUN_MATH_INSERT, - cmd.argument())); + if (!cmd.argument().empty()) { + FuncRequest cmdm(LFUN_MATH_INSERT, cmd.argument()); + inset->dispatch(cur, cmdm); + } } else { // create a macro if we see "\\newcommand" // somewhere, and an ordinary formula @@ -1372,10 +1376,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // should be used (but it asserts with Bidi enabled) // cf. http://bugzilla.lyx.org/show_bug.cgi?id=4055 // cap::replaceSelection(cur); - cur.insert(new InsetMathHull(hullSimple)); + InsetMathHull * inset = new InsetMathHull(hullSimple); + cur.insert(inset); checkAndActivateInset(cur, true); BOOST_ASSERT(cur.inMathed()); - cur.dispatch(cmd); + inset->dispatch(cur, cmd); break; } diff --git a/status.15x b/status.15x index f4d2ef3f7d..dd4b451e6a 100644 --- a/status.15x +++ b/status.15x @@ -103,6 +103,8 @@ What's new - Fix a crash when using the outline-* lfuns within mathed (bug 4330). +- Fix an assertion when entering a math object in a list environment (bug 4335). + - Correctly adjust screen fonts after the zoom or dpi settings were changed in the preferences (Mac and Windows only) (bug 4268).