* Source/NSTextStorage.m (-classForCoder, -initWithCoder:,

-encodeWithCoder:): Encode this class and not the concrete 
  one. Also call super encoding/decoding methods as they are
  correct in base now.
* Source/GSTextStorage.m (-classForPortCoder, -encodeWithCoder:,
  -replacementObjectForPortCoder:): Remove these methods.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28456 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-08-12 22:00:16 +00:00
parent 5ea075f5ab
commit 81cf28902a
3 changed files with 24 additions and 31 deletions

View file

@ -337,33 +337,36 @@ static NSNotificationCenter *nc = nil;
[self fixAttributesInRange: range];
}
- (Class) classForCoder
{
return abstract;
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
self = [super initWithCoder: aDecoder];
if ([aDecoder allowsKeyedCoding])
{
id delegate = [aDecoder decodeObjectForKey: @"NSDelegate"];
NSString *string = [aDecoder decodeObjectForKey: @"NSString"];
self = [self initWithString: string];
[self setDelegate: delegate];
}
else
{
self = [super initWithCoder: aDecoder];
}
}
return self;
}
- (void) encodeWithCoder: (NSCoder *)coder
{
[super encodeWithCoder: coder];
if ([coder allowsKeyedCoding])
{
[coder encodeObject: [self delegate] forKey: @"NSDelegate"];
[coder encodeObject: [self string] forKey: @"NSString"];
}
else
{
[super encodeWithCoder: coder];
}
}