tweaks to last commit

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32562 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-03-14 04:57:02 +00:00
parent 2d713e6cca
commit 5d165e7db8
2 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,7 @@
2011-03-13 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSTextView.m: Tweaks to last commit
2011-03-13 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSLayoutManager.m: Clear temporary attributes

View file

@ -5506,8 +5506,15 @@ static const NSInteger GSSpellingSuggestionMenuItemTag = 1;
- (void) _acceptGuess: (id)sender
{
NSString *guess = [(NSMenuItem*)sender title];
[[self textStorage] replaceCharactersInRange: [self selectedRange]
withString: guess];
NSRange range = [self selectedRange];
if (![self shouldChangeTextInRange: range replacementString: guess])
return;
[_textStorage beginEditing];
[self replaceCharactersInRange: range withString: guess];
[_textStorage endEditing];
[self didChangeText];
}
- (void) rightMouseDown: (NSEvent *)theEvent
@ -5546,7 +5553,9 @@ static const NSInteger GSSpellingSuggestionMenuItemTag = 1;
if (NSEqualRanges([self selectedRange],
[self selectionRangeForProposedRange: NSMakeRange([self selectedRange].location, 0)
granularity: NSSelectByWord]))
granularity: NSSelectByWord])
&& [self selectedRange].length > 0
&& [self isEditable])
{
// Possibly show spelling suggestions