From 35ab35ded0dfe79137fbf444b4ab25dbcbb3c96c Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Fri, 23 Nov 2001 00:27:53 +0000 Subject: [PATCH] Added some new methods that allow for lazy fixing of attributes in subclasses. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11489 72102866-910b-0410-8b05-ffd578937521 --- Headers/gnustep/gui/NSTextStorage.h | 6 ++++++ Source/NSTextStorage.m | 28 ++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Headers/gnustep/gui/NSTextStorage.h b/Headers/gnustep/gui/NSTextStorage.h index 0cf69bf0b..70dc57bcb 100644 --- a/Headers/gnustep/gui/NSTextStorage.h +++ b/Headers/gnustep/gui/NSTextStorage.h @@ -117,6 +117,12 @@ enum - (void) setDelegate: (id)delegate; - (id) delegate; +#ifndef STRICT_OPENSTEP +- (void) ensureAttributesAreFixedInRange: (NSRange)range; +- (BOOL) fixesAttributesLazily; +- (void) invalidateAttributesInRange: (NSRange)range; +#endif + @end diff --git a/Source/NSTextStorage.m b/Source/NSTextStorage.m index a88b780df..988864bcd 100644 --- a/Source/NSTextStorage.m +++ b/Source/NSTextStorage.m @@ -207,7 +207,7 @@ static Class concrete; As a consequence, if any attribute has been fixed, r != editedRange after this call. This is why we saved r in the first place. */ - [self fixAttributesInRange: r]; + [self invalidateAttributesInRange: r]; [nc postNotificationName: NSTextStorageDidProcessEditingNotification object: self]; @@ -282,15 +282,19 @@ static Class concrete; return _delegate; } +- (void) ensureAttributesAreFixedInRange: (NSRange)range +{ + // Do nothing as the default is not lazy fixing, so all is done already +} + +- (BOOL) fixesAttributesLazily +{ + return NO; +} + +- (void) invalidateAttributesInRange: (NSRange)range +{ + [self fixAttributesInRange: range]; +} + @end - - -/* - * Notifications - */ - -NSString *NSTextStorageWillProcessEditingNotification = - @"NSTextStorageWillProcessEditingNotification"; -NSString *NSTextStorageDidProcessEditingNotification = - @"NSTextStorageDidProcessEditingNotification"; -