mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 07:50:53 +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 NSNotification;
|
||||||
@class NSColor;
|
@class NSColor;
|
||||||
@class NSFont;
|
@class NSFont;
|
||||||
|
@class NSTextStorage;
|
||||||
|
|
||||||
typedef enum _NSTextAlignment {
|
typedef enum _NSTextAlignment {
|
||||||
NSLeftTextAlignment = 0,
|
NSLeftTextAlignment = 0,
|
||||||
|
@ -117,7 +118,7 @@ typedef enum _NSSelectionAffinity {
|
||||||
NSMutableDictionary *_typingAttributes;
|
NSMutableDictionary *_typingAttributes;
|
||||||
|
|
||||||
// content
|
// content
|
||||||
NSMutableAttributedString *_textStorage;
|
NSTextStorage *_textStorage;
|
||||||
|
|
||||||
int _spellCheckerDocumentTag;
|
int _spellCheckerDocumentTag;
|
||||||
|
|
||||||
|
|
|
@ -481,6 +481,9 @@ SANITY();
|
||||||
RELEASE(info);
|
RELEASE(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self edited: NSTextStorageEditedAttributes
|
||||||
|
range: range
|
||||||
|
changeInLength: 0];
|
||||||
SANITY();
|
SANITY();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -598,6 +601,10 @@ SANITY();
|
||||||
}
|
}
|
||||||
SANITY();
|
SANITY();
|
||||||
[textChars replaceCharactersInRange: range withString: aString];
|
[textChars replaceCharactersInRange: range withString: aString];
|
||||||
|
|
||||||
|
[self edited: NSTextStorageEditedCharacters
|
||||||
|
range: range
|
||||||
|
changeInLength: [aString length] - range.length];
|
||||||
SANITY();
|
SANITY();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,17 +80,6 @@ static Class concrete;
|
||||||
return nil;
|
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
|
* Managing NSLayoutManagers
|
||||||
*/
|
*/
|
||||||
|
@ -195,6 +184,11 @@ changeInLength: [attributedString length] - aRange.length];
|
||||||
|
|
||||||
NSDebugLLog(@"NSText", @"processEditing called in NSTextStorage.");
|
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
|
[nc postNotificationName: NSTextStorageWillProcessEditingNotification
|
||||||
object: self];
|
object: self];
|
||||||
|
|
||||||
|
@ -204,6 +198,7 @@ changeInLength: [attributedString length] - aRange.length];
|
||||||
|
|
||||||
[nc postNotificationName: NSTextStorageDidProcessEditingNotification
|
[nc postNotificationName: NSTextStorageDidProcessEditingNotification
|
||||||
object: self];
|
object: self];
|
||||||
|
editCount--;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calls textStorage:edited:range:changeInLength:invalidatedRange: for
|
* Calls textStorage:edited:range:changeInLength:invalidatedRange: for
|
||||||
|
|
Loading…
Reference in a new issue