Adopted implemtantion of [checkSpelling:] to changes in

NSSpellChecker. [updateSpellingPanelWithMisspelledWord:] is now
called from here.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11301 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2001-11-03 09:56:02 +00:00
parent d7eea20d57
commit 295022c274

View file

@ -846,6 +846,7 @@ static NSNotificationCenter *nc;
- (void) checkSpelling: (id)sender - (void) checkSpelling: (id)sender
{ {
NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker]; NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker];
NSString *misspelledWord = nil;
NSRange errorRange; NSRange errorRange;
int count = 0; int count = 0;
@ -859,10 +860,13 @@ static NSNotificationCenter *nc;
if (errorRange.length) if (errorRange.length)
{ {
[self setSelectedRange: errorRange]; [self setSelectedRange: errorRange];
misspelledWord = [[self string] substringFromRange: errorRange];
[sp updateSpellingPanelWithMisspelledWord: misspelledWord];
} }
else else
{ {
NSBeep(); [sp updateSpellingPanelWithMisspelledWord: @""];
} }
} }