From 6bc07bc1754879b664114d07086d8c789619ecb9 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Mon, 13 Jun 2011 14:45:41 +0000 Subject: [PATCH] Add keyed coding for print info. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33290 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/NSPrintInfo.m | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) 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]; }