correct the second try for misspelled words to catch abbreviations

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35444 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stephan Witt 2010-09-19 11:49:10 +00:00
parent b065b96457
commit 9304b5eadc

View File

@ -3473,7 +3473,7 @@ SpellChecker::Result Paragraph::spellCheck(pos_type & from, pos_type & to,
return result;
locateWord(from, to, WHOLE_WORD);
if (from == to || from >= pos_type(d->text_.size()))
if (from == to || from >= size())
return result;
docstring word = asString(from, to, AS_STR_INSETS);
@ -3493,7 +3493,13 @@ SpellChecker::Result Paragraph::spellCheck(pos_type & from, pos_type & to,
result = speller->check(wl);
if (SpellChecker::misspelled(result) && trailing_dot) {
word = word.append(from_ascii("."));
wl = WordLangTuple(word, lang);
result = speller->check(wl);
if (!SpellChecker::misspelled(result)) {
LYXERR(Debug::GUI, "misspelled word now correct was: \"" <<
word << "\" [" <<
from << ".." << to << "]");
}
}
}
d->setMisspelled(from, to, result);