Add implementation for validateUserInterfaceAction:

This commit is contained in:
Gregory John Casamento 2020-08-18 13:32:13 -04:00
parent a02336f84f
commit 4d90930d64
2 changed files with 15 additions and 0 deletions

View file

@ -23,6 +23,7 @@
*/ */
#import "AppKit/NSTextCheckingController.h" #import "AppKit/NSTextCheckingController.h"
#import "AppKit/NSSpellChecker.h"
@implementation NSTextCheckingController @implementation NSTextCheckingController
@ -61,6 +62,13 @@
- (void) checkSpelling: (id)sender - (void) checkSpelling: (id)sender
{ {
int wordCount = 0;
[[NSSpellChecker sharedSpellChecker] checkSpellingOfString: [_client string]
startingAt: 0
language: nil
wrap: NO
inSpellDocumentWithTag: _spellCheckerDocumentTag
wordCount: &wordCount];
} }
- (void) checkTextInRange: (NSRange)range - (void) checkTextInRange: (NSRange)range

View file

@ -185,6 +185,13 @@
- (BOOL) validateUserInterfaceAction: (id<NSValidatedUserInterfaceItem>)item - (BOOL) validateUserInterfaceAction: (id<NSValidatedUserInterfaceItem>)item
{ {
SEL action = [item action];
if (sel_isEqual(action, @selector(performTextFinderAction:)) ||
sel_isEqual(action, @selector(performFindPanelAction:)))
{
return [self validateAction: [item tag]];
}
return YES; return YES;
} }