avoid spell check with out of range start value

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35292 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stephan Witt 2010-09-06 06:55:31 +00:00
parent ed4ae48e85
commit 9b1e0fc3c8

View File

@ -94,11 +94,12 @@ SpellCheckResult AppleSpeller_check(AppleSpeller speller, const char * word, con
NSString * lang_ = toString(lang);
SpellCheckResult result = SPELL_CHECK_FAILED;
int start = 0;
int length = [word_ length];
[speller->misspelled release];
speller->misspelled = nil;
while (result == SPELL_CHECK_FAILED) {
while (result == SPELL_CHECK_FAILED && start < length) {
NSRange match = [speller->checker
checkSpellingOfString:word_
startingAt:start