CPFormatter support for CPControl which actually works.

This commit is contained in:
Alexander Ljungberg
2011-06-13 18:39:17 -07:00
parent 4421b55613
commit 91509e7d36
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -19,6 +19,8 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "../Foundation/Ref.h"
@import "CPFont.j"
@import "CPShadow.j"
@@ -526,7 +528,7 @@ var CPControlBlackColor = [CPColor blackColor];
if (_formatter)
{
var formattedValue = nil;
if ([_formatter getObjectValue:@ref(formattedValue) forString:value errorDescription:NULL])
if ([_formatter getObjectValue:AT_REF(formattedValue) forString:value errorDescription:NULL])
value = formattedValue;
}
+3 -1
View File
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "Ref.h"
@import <Foundation/CPString.j>
@import <Foundation/CPFormatter.j>
@@ -126,7 +127,8 @@ CPNumberFormatterRoundHalfUp = CPRoundPlain;
{
// TODO Error handling.
var value = [self numberFromString:aString];
@deref(anObject, value);
AT_DEREF(anObject, value);
return YES;
}