NSText fixups

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6360 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-03-23 11:31:25 +00:00
parent f5384ec7aa
commit 7bbe363cef
3 changed files with 15 additions and 12 deletions

View file

@ -42,6 +42,7 @@
@class NSNotification;
@class NSColor;
@class NSFont;
@class NSTextStorage;
typedef enum _NSTextAlignment {
NSLeftTextAlignment = 0,
@ -117,7 +118,7 @@ typedef enum _NSSelectionAffinity {
NSMutableDictionary *_typingAttributes;
// content
NSMutableAttributedString *_textStorage;
NSTextStorage *_textStorage;
int _spellCheckerDocumentTag;

View file

@ -481,6 +481,9 @@ SANITY();
RELEASE(info);
}
[self edited: NSTextStorageEditedAttributes
range: range
changeInLength: 0];
SANITY();
}
@ -598,6 +601,10 @@ SANITY();
}
SANITY();
[textChars replaceCharactersInRange: range withString: aString];
[self edited: NSTextStorageEditedCharacters
range: range
changeInLength: [aString length] - range.length];
SANITY();
}

View file

@ -80,17 +80,6 @@ static Class concrete;
return nil;
}
- (void) replaceCharactersInRange: (NSRange)aRange
withAttributedString: (NSAttributedString *)attributedString
{
[super replaceCharactersInRange: aRange
withAttributedString: attributedString];
[self edited: NSTextStorageEditedCharacters | NSTextStorageEditedAttributes
range: aRange
changeInLength: [attributedString length] - aRange.length];
}
/*
* Managing NSLayoutManagers
*/
@ -195,6 +184,11 @@ changeInLength: [attributedString length] - aRange.length];
NSDebugLLog(@"NSText", @"processEditing called in NSTextStorage.");
/*
* The editCount gets decreased later again, so that changes by
* the delegate dont trigger a new processEditing
*/
editCount++;
[nc postNotificationName: NSTextStorageWillProcessEditingNotification
object: self];
@ -204,6 +198,7 @@ changeInLength: [attributedString length] - aRange.length];
[nc postNotificationName: NSTextStorageDidProcessEditingNotification
object: self];
editCount--;
/*
* Calls textStorage:edited:range:changeInLength:invalidatedRange: for