From a1a9c2ac03d8ca56e5d8304712971096c19595ba Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Sat, 4 Mar 2000 18:30:11 +0000 Subject: [PATCH] Fix so that rects are correctly encoded on macosx git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6168 72102866-910b-0410-8b05-ffd578937521 --- Model/GMArchiver.m | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Model/GMArchiver.m b/Model/GMArchiver.m index e293376a2..fc0f25cfe 100644 --- a/Model/GMArchiver.m +++ b/Model/GMArchiver.m @@ -534,8 +534,10 @@ - (void) encodePoint: (NSPoint)point withName: (NSString*)name { if (!findingConditionals && name) { - id valueString = NSStringFromPoint (point); - + /* Macosx NSStringFromPoint is not OPENstep compliant, so we do it by hand. */ + id valueString = [NSString stringWithFormat: @"{x=%f; y=%f}", + point.x, point.y]; + [lastObjectRepresentation setObject: valueString forKey: name]; } } @@ -543,7 +545,9 @@ - (void) encodeSize: (NSSize)size withName: (NSString*)name { if (!findingConditionals) { - id valueString = NSStringFromSize (size); + /* Macosx NSStringFromSize is not OPENstep compliant, so we do it by hand. */ + id valueString = [NSString stringWithFormat: @"{width=%f; height=%f}", + size.width, size.height]; [lastObjectRepresentation setObject: valueString forKey: name]; } @@ -552,8 +556,11 @@ - (void) encodeRect: (NSRect)rect withName: (NSString*)name { if (!findingConditionals) { - id valueString = NSStringFromRect (rect); - + /* Macosx NSStringFromRect is not OPENstep compliant, so we do it by hand. */ + id valueString = [NSString stringWithFormat: + @"{x=%f; y=%f; width=%f; height=%f}", + rect.origin.x, rect.origin.y, + rect.size.width, rect.size.height]; [lastObjectRepresentation setObject: valueString forKey: name]; } }