implemented changes suggested by review

This commit is contained in:
Gregory John Casamento 2020-08-18 20:23:39 -04:00
parent 1821d34ff2
commit ebafa1786d
2 changed files with 10 additions and 19 deletions

View file

@ -120,12 +120,7 @@
- (void) performFindPanelAction: (id)sender
{
if (_finder == nil)
{
_finder = [[GSTextFinder alloc] init];
}
[self performAction: [sender tag]];
[self validateUserInterfaceAction: sender];
}
- (void) performAction: (NSTextFinderAction)op

View file

@ -93,7 +93,6 @@
#import "AppKit/NSTextStorage.h"
#import "AppKit/NSTextView.h"
#import "AppKit/NSWindow.h"
#import "AppKit/NSStringDrawing.h"
#import "GSGuiPrivate.h"
#import "GSTextFinder.h"
@ -6139,21 +6138,18 @@ configuation! */
NSUInteger rectCount = 0;
NSRect *rects;
NSMutableArray *result = [NSMutableArray array];
NSUInteger idx = 0;
rects = [_layoutManager rectArrayForCharacterRange: range
withinSelectedCharacterRange: NSMakeRange(NSNotFound, 0)
inTextContainer: _textContainer
rectCount: &rectCount];
if (_layoutManager)
for (idx = 0; idx < rectCount; idx++)
{
NSUInteger idx = 0;
rects = [_layoutManager rectArrayForCharacterRange: range
withinSelectedCharacterRange: NSMakeRange(NSNotFound, 0)
inTextContainer: _textContainer
rectCount: &rectCount];
for(idx = 0; idx < rectCount; idx++)
{
NSRect r = rects[idx];
NSValue *v = [NSValue valueWithRect: r];
[result addObject: v];
}
NSRect r = rects[idx];
NSValue *v = [NSValue valueWithRect: r];
[result addObject: v];
}
return result;