]> git.lyx.org Git - lyx.git/commitdiff
correct mark of misspelled word if it is the last of paragraph
authorStephan Witt <switt@lyx.org>
Sat, 2 Apr 2011 14:03:35 +0000 (14:03 +0000)
committerStephan Witt <switt@lyx.org>
Sat, 2 Apr 2011 14:03:35 +0000 (14:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38206 a592a061-630c-0410-9148-cb99ea01b6c8

src/Paragraph.cpp

index 81deac4f393a180862e33f1d0a76661f671bf6eb..5f931f4d93401f2d91444a2714fb80b18834a0df 100644 (file)
@@ -3781,9 +3781,9 @@ void Paragraph::spellCheck() const
 bool Paragraph::isMisspelled(pos_type pos, bool check_boundary) const
 {
        bool result = SpellChecker::misspelled(d->speller_state_.getState(pos));
-       if (result || pos <= 0 || pos >= size())
+       if (result || pos <= 0 || pos > size())
                return result;
-       if (check_boundary && isWordSeparator(pos))
+       if (check_boundary && (pos == size() || isWordSeparator(pos)))
                result = SpellChecker::misspelled(d->speller_state_.getState(pos - 1));
        return result;
 }