From: Jean-Marc Lasgouttes Date: Tue, 7 Jul 2009 10:50:27 +0000 (+0000) Subject: Fix #6013: SIGABRT if we spell check inside a math macro, and then hit replace X-Git-Tag: 2.0.0~6143 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=73f9991eec5c076466d3847f324f4f0eb03eab3a;p=features.git Fix #6013: SIGABRT if we spell check inside a math macro, and then hit replace This is just a matter of checking that we are in an insettext before calling replaceSelectionWithString. I guess there are other good ways to fix the crash. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30399 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index 73e1254ee1..f3b001c993 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -163,6 +163,8 @@ void GuiSpellchecker::on_replacePB_clicked() LYXERR(Debug::GUI, "Replace (" << replacement << ")"); BufferView * bv = const_cast(bufferview()); + if (!bv->cursor().inTexted()) + return; cap::replaceSelectionWithString(bv->cursor(), replacement, true); bv->buffer().markDirty(); // If we used an LFUN, we would not need that