From 73f9991eec5c076466d3847f324f4f0eb03eab3a Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 7 Jul 2009 10:50:27 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiSpellchecker.cpp | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.39.5