mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 20:49:13 +00:00
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:
parent
f5384ec7aa
commit
7bbe363cef
3 changed files with 15 additions and 12 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue