]> git.lyx.org Git - features.git/commitdiff
Fix #6013: SIGABRT if we spell check inside a math macro, and then hit replace
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 7 Jul 2009 10:50:27 +0000 (10:50 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 7 Jul 2009 10:50:27 +0000 (10:50 +0000)
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

index 73e1254ee15e8f34eab52a59a7dd28b979636ab5..f3b001c993c7a8ddf83bc589c54148b5bfd5fbec 100644 (file)
@@ -163,6 +163,8 @@ void GuiSpellchecker::on_replacePB_clicked()
 
        LYXERR(Debug::GUI, "Replace (" << replacement << ")");
        BufferView * bv = const_cast<BufferView *>(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