diff --git a/ChangeLog b/ChangeLog index 71f9e29ba..3efe52de3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-06-13 Fred Kiefer + + * Source/NSPrintInfo.m: Add keyed coding. + 2011-06-13 Fred Kiefer * Source/NSTextView.m: Add methods -_becomeRulerClient and diff --git a/Source/NSPrintInfo.m b/Source/NSPrintInfo.m index 020ddda73..96ffdee7d 100644 --- a/Source/NSPrintInfo.m +++ b/Source/NSPrintInfo.m @@ -486,7 +486,14 @@ static NSPrintInfo *sharedPrintInfo = nil; [dict removeObjectForKey: NSPrintPrinter]; } - [aCoder encodePropertyList: dict]; + if ([aCoder allowsKeyedCoding]) + { + [aCoder encodeObject: dict forKey: @"NSAttributes"]; + } + else + { + [aCoder encodePropertyList: dict]; + } RELEASE(dict); } @@ -494,8 +501,14 @@ static NSPrintInfo *sharedPrintInfo = nil; { NSMutableDictionary *dict; - dict = [aDecoder decodePropertyList]; - + if ([aDecoder allowsKeyedCoding]) + { + dict = [aDecoder decodeObjectForKey: @"NSAttributes"]; + } + else + { + dict = [aDecoder decodePropertyList]; + } return [self initWithDictionary: dict]; }