* 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
This commit is contained in:
Eric Wasylishen 2011-04-27 02:43:03 +00:00
parent 8a890d9926
commit ff0b5abd62
2 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2011-04-26 Eric Wasylishen <ewasylishen@gmail.com>
* 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 <ewasylishen@gmail.com>
* Headers/Foundation/NSObjCRuntime.h: Add CGFLOAT_MIN and CGFLOAT_MAX

View file

@ -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"])