]> git.lyx.org Git - features.git/commitdiff
make a second try for misspelled words to catch abbreviations
authorStephan Witt <switt@lyx.org>
Fri, 17 Sep 2010 17:39:18 +0000 (17:39 +0000)
committerStephan Witt <switt@lyx.org>
Fri, 17 Sep 2010 17:39:18 +0000 (17:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35427 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp

index 7efa38e6f1d77b8051086ce6d8e99f87a48bc623..b12d7add2b53ec869737594a97b37ecf0db773f1 100644 (file)
@@ -3488,8 +3488,14 @@ SpellChecker::Result Paragraph::spellCheck(pos_type & from, pos_type & to,
                // Ignore words with digits
                // FIXME: make this customizable
                // (note that some checkers ignore words with digits by default)
-               if (!hasDigit(word))
+               if (!hasDigit(word)) {
+                       bool const trailing_dot = to < size() && d->text_[to] == '.';
                        result = speller->check(wl);
+                       if (SpellChecker::misspelled(result) && trailing_dot) {
+                               word = word.append(from_ascii("."));
+                               result = speller->check(wl);
+                       }
+               }
                d->setMisspelled(from, to, result);
        } else {
                result = d->speller_state_.getState(from);