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
This commit is contained in:
Jean-Marc Lasgouttes 2009-07-07 10:50:27 +00:00
parent 1c6eea89b4
commit 73f9991eec

View File

@ -163,6 +163,8 @@ void GuiSpellchecker::on_replacePB_clicked()
LYXERR(Debug::GUI, "Replace (" << replacement << ")"); LYXERR(Debug::GUI, "Replace (" << replacement << ")");
BufferView * bv = const_cast<BufferView *>(bufferview()); BufferView * bv = const_cast<BufferView *>(bufferview());
if (!bv->cursor().inTexted())
return;
cap::replaceSelectionWithString(bv->cursor(), replacement, true); cap::replaceSelectionWithString(bv->cursor(), replacement, true);
bv->buffer().markDirty(); bv->buffer().markDirty();
// If we used an LFUN, we would not need that // If we used an LFUN, we would not need that