Fix encoding

This commit is contained in:
Gregory John Casamento 2020-03-11 19:00:52 -04:00
parent ddce45a6a2
commit 38f4292989

View file

@ -541,6 +541,15 @@ static NSLock *_fontCollectionLock = nil;
return fc;
}
- (void) encodeWithCoder: (NSCoder *)coder
{
if ([coder allowsKeyedCoding])
{
[coder encodeObject: _fontCollectionDictionary
forKey: @"NSFontCollectionDictionary"];
}
}
- (instancetype) initWithCoder: (NSCoder *)coder
{
self = [super init];
@ -548,21 +557,12 @@ static NSLock *_fontCollectionLock = nil;
{
if ([coder allowsKeyedCoding])
{
[coder encodeObject: _fontCollectionDictionary
forKey: @"NSFontCollectionDictionary"];
ASSIGN(_fontCollectionDictionary,
[coder decodeObjectForKey: @"NSFontCollectionDictionary"]);
}
}
return self;
}
- (void) encodeWithCoder: (NSCoder *)coder
{
if ([coder allowsKeyedCoding])
{
ASSIGN(_fontCollectionDictionary,
[coder decodeObjectForKey: @"NSFontCollectionDictionary"]);
}
}
@end