light tidying

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39568 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-03-20 11:53:01 +00:00
parent bc2927bd2d
commit 1ee226b495
2 changed files with 37 additions and 32 deletions

View file

@ -856,8 +856,9 @@ static NSRecursiveLock *classLock = nil;
- (BOOL) isEqual: (id)obj
{
if ([obj isKindOfClass: [self class]])
{
return [_localeId isEqual: [obj localeIdentifier]];
}
return NO;
}
@ -1057,7 +1058,6 @@ static NSRecursiveLock *classLock = nil;
[nFor setLocale: self];
[nFor setNumberStyle: NSNumberFormatterDecimalStyle];
result = [nFor decimalSeparator];
RELEASE(nFor);
return result;
}
@ -1071,7 +1071,6 @@ static NSRecursiveLock *classLock = nil;
[nFor setLocale: self];
[nFor setNumberStyle: NSNumberFormatterDecimalStyle];
result = [nFor groupingSeparator];
RELEASE(nFor);
return result;
}

View file

@ -1523,17 +1523,18 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4;
return internal->_genDecimal; // FIXME
}
- (void) setLocale: (NSLocale *)locale
{
RELEASE(internal->_locale);
if (locale == nil)
if (nil == locale)
{
locale = [NSLocale currentLocale];
internal->_locale = RETAIN(locale);
}
if (NO == [locale isEqual: internal->_locale])
{
ASSIGN(internal->_locale, locale);
[self _resetUNumberFormat];
}
}
- (NSLocale *) locale
{
@ -2143,15 +2144,16 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4;
int32_t idx;
if (internal->_formatter)
{
unum_close(internal->_formatter);
}
cLocaleId = [[internal->_locale localeIdentifier] UTF8String];
style = NSToICUFormatStyle (internal->_style);
internal->_formatter = unum_open (style, NULL, 0, cLocaleId, NULL, &err);
if (U_FAILURE(err))
{
internal->_formatter = NULL;
}
// Reset all properties
for (idx = 0; idx < MAX_SYMBOLS; ++idx)
{
@ -2159,7 +2161,9 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4;
{
length = [internal->_symbols[idx] length];
if (length > BUFFER_SIZE)
{
length = BUFFER_SIZE;
}
[internal->_symbols[idx] getCharacters: buffer
range: NSMakeRange (0, length)];
unum_setSymbol (internal->_formatter, idx, buffer, length, &err);
@ -2172,7 +2176,9 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4;
{
length = [internal->_textAttributes[idx] length];
if (length > BUFFER_SIZE)
{
length = BUFFER_SIZE;
}
[internal->_textAttributes[idx] getCharacters: buffer
range: NSMakeRange (0, length)];
unum_setTextAttribute