From: Stephan Witt Date: Sat, 2 Apr 2011 14:03:35 +0000 (+0000) Subject: correct mark of misspelled word if it is the last of paragraph X-Git-Tag: 2.0.0~278 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=242b76f7a5eb93d67a2179282256dc5c57cc4ed6;p=lyx.git correct mark of misspelled word if it is the last of paragraph git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38206 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 81deac4f39..5f931f4d93 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -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; }