From bffc43307ded8b6e9531db3c080d891ff25890af Mon Sep 17 00:00:00 2001 From: ericwa Date: Wed, 27 Apr 2011 02:43:03 +0000 Subject: [PATCH] * Source/NSNumberFormatter.m: Move the body of -init to a method called -_NSNumberFormatterInit, and call this in -initWithCoder: so that instances created with -initWithCoder: are initialized correctly. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32931 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSNumberFormatter.m | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e60c7741f..dc27e5309 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-04-26 Eric Wasylishen + + * Source/NSNumberFormatter.m: Move the body of -init to a method called + -_NSNumberFormatterInit, and call this in -initWithCoder: so that + instances created with -initWithCoder: are initialized correctly. + 2011-04-26 Eric Wasylishen * Headers/Foundation/NSObjCRuntime.h: Add CGFLOAT_MIN and CGFLOAT_MAX diff --git a/Source/NSNumberFormatter.m b/Source/NSNumberFormatter.m index 0165ec7a5..e716cd529 100644 --- a/Source/NSNumberFormatter.m +++ b/Source/NSNumberFormatter.m @@ -613,14 +613,12 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4; return _hasThousandSeparators; } -- (id) init +- (id) _NSNumberFormatterInit { id o; int idx; NSZone *z = [self zone]; - GS_CREATE_INTERNAL(NSNumberFormatter) - _allowsFloats = YES; _decimalSeparator = '.'; _thousandSeparator = ','; @@ -660,6 +658,14 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4; #endif [self setMaximumFractionDigits: 0]; + return self; +} + +- (id) init +{ + GS_CREATE_INTERNAL(NSNumberFormatter) + + self = [self _NSNumberFormatterInit]; return self; } @@ -668,6 +674,8 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4; { GS_CREATE_INTERNAL(NSNumberFormatter) + self = [self _NSNumberFormatterInit]; + if ([decoder allowsKeyedCoding]) { if ([decoder containsValueForKey: @"NS.allowsfloats"])