mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-16 03:30:42 +00:00
Fixed: number formatter was called twice for every setObjectValue.
Previously setObjectValue checked for a formatted value, and then called [self stringValue], which ended up formatting the value again. Now all of the cases (no formatter, formatter succeeds, formatter fails) are handled explicitly in setObjectValue, eliminating the extra call to the formatter.
This commit is contained in:
1 parent
a5e62ed132
commit
650bc77b2c
2 files changed
+6
-3
No files matched your search
+1
-1
@@ -530,7 +530,7 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
return formattedValue;
|
||||
}
|
||||
|
||||
return (_value === undefined || _value === nil) ? "" : String(_value);
|
||||
return (_value === undefined || _value === nil) ? @"" : String(_value);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -1103,10 +1103,13 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
value = undefined;
|
||||
|
||||
[super setObjectValue:value];
|
||||
_stringValue = (value === nil || value === undefined) ? @"" : String(value);
|
||||
}
|
||||
else
|
||||
_stringValue = formattedString;
|
||||
}
|
||||
|
||||
_stringValue = [self stringValue];
|
||||
else
|
||||
_stringValue = [self stringValue];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
|
||||
|
||||
Reference in new issue
Block a user