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
This commit is contained in:
Stephan Witt 2011-04-02 14:03:35 +00:00
parent 30339c03ad
commit 242b76f7a5

View 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;
}