]> git.lyx.org Git - features.git/commitdiff
correct the second try for misspelled words to catch abbreviations
authorStephan Witt <switt@lyx.org>
Sun, 19 Sep 2010 11:49:10 +0000 (11:49 +0000)
committerStephan Witt <switt@lyx.org>
Sun, 19 Sep 2010 11:49:10 +0000 (11:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35444 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp

index b12d7add2b53ec869737594a97b37ecf0db773f1..9027bc62ac71dfb67ea72adc0d6943970b881113 100644 (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);