* 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:
ericwa 2011-04-27 02:43:03 +00:00
parent e9e69ac659
commit bffc43307d
2 changed files with 17 additions and 3 deletions

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