mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 14:29:21 +00:00
correct result array use in makeSuggestionAppleSpeller
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34862 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7b34b13b71
commit
aebcaa74b0
@ -118,12 +118,12 @@ size_t makeSuggestionAppleSpeller(AppleSpeller speller, const char * word, const
|
|||||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||||
NSString * word_ = toString(speller, word);
|
NSString * word_ = toString(speller, word);
|
||||||
NSString * lang_ = toString(speller, lang);
|
NSString * lang_ = toString(speller, lang);
|
||||||
|
NSArray * result ;
|
||||||
|
|
||||||
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
|
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
|
||||||
// Mac OS X 10.6 only
|
// Mac OS X 10.6 only
|
||||||
NSInteger slen = [word_ length];
|
NSInteger slen = [word_ length];
|
||||||
NSRange range = { 0, slen };
|
NSRange range = { 0, slen };
|
||||||
NSArray * result ;
|
|
||||||
|
|
||||||
if ([NSSpellChecker instancesRespondToSelector:@selector(guessesForWordRange:)]) {
|
if ([NSSpellChecker instancesRespondToSelector:@selector(guessesForWordRange:)]) {
|
||||||
result = [speller->checker guessesForWordRange:range
|
result = [speller->checker guessesForWordRange:range
|
||||||
@ -132,11 +132,11 @@ size_t makeSuggestionAppleSpeller(AppleSpeller speller, const char * word, const
|
|||||||
inSpellDocumentWithTag:speller->doctag];
|
inSpellDocumentWithTag:speller->doctag];
|
||||||
} else {
|
} else {
|
||||||
[speller->checker setLanguage:lang_];
|
[speller->checker setLanguage:lang_];
|
||||||
NSArray * result = [speller->checker guessesForWord:word_];
|
result = [speller->checker guessesForWord:word_];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
[speller->checker setLanguage:lang_];
|
[speller->checker setLanguage:lang_];
|
||||||
NSArray * result = [speller->checker guessesForWord:word_];
|
result = [speller->checker guessesForWord:word_];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[word_ release];
|
[word_ release];
|
||||||
|
Loading…
Reference in New Issue
Block a user