* Source/NSLayoutManager.m: Clear temporary attributes

on the modified range when informed of a change in the text
storage
* Source/NSTextView.m: Add a context menu with spelling
suggestions and cut/copy/paste


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32561 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ericwa 2011-03-14 04:19:32 +00:00
parent d606354c9d
commit abedebf974
3 changed files with 118 additions and 0 deletions

View file

@ -2294,12 +2294,28 @@ this file describes this.
if (_temporaryAttributes != nil && (mask & NSTextStorageEditedCharacters) != 0)
{
int i;
NSArray *attrs;
NSRange oldRange = NSMakeRange(range.location, range.length - lengthChange);
NSString *replacementString = [[GSDummyMutableString alloc] initWithLength: range.length];
[_temporaryAttributes replaceCharactersInRange: oldRange
withString: replacementString];
[replacementString release];
// In addition, clear any temporary attributes that may have been extended
// over the affected range
if (range.length > 0)
{
attrs = [[self temporaryAttributesAtCharacterIndex: range.location
effectiveRange: NULL] allKeys];
for (i=0; i<[attrs count]; i++)
{
[self removeTemporaryAttribute: [attrs objectAtIndex: i]
forCharacterRange: range];
}
}
}
[self invalidateGlyphsForCharacterRange: invalidatedRange