fix a crash when moving cursor from text to a math inset with spellcheck_continuously on

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37018 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stephan Witt 2010-12-27 21:59:17 +00:00
parent 3cdb7d3062
commit 6be43c24f4
2 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@ void PersonalWordList::load()
if (line == header()) {
while (ifs) {
getline(ifs, line);
if (!line.empty()) {
if (!line.empty() && !line[0] == '#') {
docstring const word = from_utf8(line);
insert(word);
}
@ -86,6 +86,8 @@ void PersonalWordList::save()
docstring_list::const_iterator et = words_.end();
ofs << header() << "\n";
ofs << "# encoding: utf-8\n";
ofs << "# one word per line\n";
for (; it != et; ++it) {
ofs << to_utf8(*it) << "\n";
}

View File

@ -2174,14 +2174,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
needsUpdate |= (cur.pos() != cur.lastpos()) && cur.selection();
if (lyxrc.spellcheck_continuously && !needsUpdate) {
if (lyxrc.spellcheck_continuously && !needsUpdate && cur.inTexted()) {
// Check for misspelled text
// The redraw is useful because of the painting of
// misspelled markers depends on the cursor position.
// Trigger a redraw for cursor moves inside misspelled text.
if (cur.paragraph().id() == last_pid && cur.pos() != last_pos) {
needsUpdate |= last_misspelled || cur.paragraph().isMisspelled(cur.pos());
} else if (cur.paragraph().id() != last_pid) {
if (cur.paragraph().id() != last_pid || cur.pos() != last_pos) {
needsUpdate |= last_misspelled || cur.paragraph().isMisspelled(cur.pos());
}
}