diff --git a/ChangeLog b/ChangeLog index bb3ec1057..1d56525e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-24 Fred Kiefer + + * Source/NSAffineTransform.m (-initWithCoder:, encodeWithCoder:): + Don't do anything for the keyed coding case. + * Source/NSDictionary.m (-initWithCoder:): Add another keyed + coding case. + 2011-10-22 Fred Kiefer * Source/NSProcessInfo.m: Add includes needed for the HAVE_PROCFS diff --git a/Source/NSAffineTransform.m b/Source/NSAffineTransform.m index 4119ea6c8..fac50959d 100644 --- a/Source/NSAffineTransform.m +++ b/Source/NSAffineTransform.m @@ -591,9 +591,26 @@ static NSAffineTransformStruct identityTransform = { { NSAffineTransformStruct replace; - [aCoder decodeArrayOfObjCType: @encode(CGFloat) - count: 6 - at: (CGFloat*)&replace]; + if ([aCoder allowsKeyedCoding]) + { + // FIXME + /* + NSData *data = [aCoder decodeObjectForKey: @"NSTransformStruct"]; + unsigned int cursor = 0; + // We get lengths of 12 and 18 + NSLog(@"length %d data %@", [data length], data); + [data deserializeDataAt: (CGFloat*)&replace + ofObjCType: "[6f]" + atCursor: &cursor + context: nil]; + */ + } + else + { + [aCoder decodeArrayOfObjCType: @encode(CGFloat) + count: 6 + at: (CGFloat*)&replace]; + } [self setTransformStruct: replace]; return self; } @@ -603,9 +620,16 @@ static NSAffineTransformStruct identityTransform = { NSAffineTransformStruct replace; replace = [self transformStruct]; - [aCoder encodeArrayOfObjCType: @encode(CGFloat) - count: 6 - at: (CGFloat*)&replace]; + if ([aCoder allowsKeyedCoding]) + { + // FIXME + } + else + { + [aCoder encodeArrayOfObjCType: @encode(CGFloat) + count: 6 + at: (CGFloat*)&replace]; + } } @end /* NSAffineTransform */ diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index f3848a8d7..170ac0f27 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -315,13 +315,22 @@ static SEL appSel; { if ([aCoder allowsKeyedCoding]) { - id keys; - id objects; + id keys = nil; + id objects = nil; + + if ([aCoder containsValueForKey: @"NS.keys"]) + { + keys = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey: + @"NS.keys"]; + objects = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey: + @"NS.objects"]; + } + else if ([aCoder containsValueForKey: @"dict.sortedKeys"]) + { + keys = [aCoder decodeObjectForKey: @"dict.sortedKeys"]; + objects = [aCoder decodeObjectForKey: @"dict.values"]; + } - keys = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey: - @"NS.keys"]; - objects = [(NSKeyedUnarchiver*)aCoder _decodeArrayOfObjectsForKey: - @"NS.objects"]; if (keys == nil) { unsigned i = 0;