discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

List of GNUstep fixes


From: Andreas Höschler
Subject: List of GNUstep fixes
Date: Tue, 13 Dec 2005 18:59:13 +0100

Hello,

thank you for providing all these patches, some look quite nice others
rather like local hacks that should be kept in custome code.

I have another one.

NSCell
We make sure the value returned by objectValue complies with the set formatter, e.g. doing setObjectValue:[NSCalendarDate calendarDate] and then retrieving the objectValue should give us 2005-12-13 00:00:00 if the formatter is set to %d.%m.%Y. The old implementation returned something like 2005-12-13 17:35:02 which is wrong.

- (void)setObjectValue: (id)object
{
id newContents;

ASSIGN (_objectValue, object);

if (_formatter == nil)
{
if ([object isKindOfClass: [NSString class]] == YES)
{
newContents = object;
_cell.contents_is_attributed_string = NO;
_cell.has_valid_object_value = YES;
}
if ([object isKindOfClass: [NSAttributedString class]] == YES)
{
newContents = object;
_cell.contents_is_attributed_string = YES;
_cell.has_valid_object_value = YES;
}
else
{
newContents = [_objectValue description];
_cell.contents_is_attributed_string = NO;
_cell.has_valid_object_value = YES;
}
}
else
{
newContents = [_formatter stringForObjectValue: _objectValue];
_cell.contents_is_attributed_string = NO;
if (newContents != nil)
{
// Smartsoft Begin
id objectValue;
BOOL result = [_formatter getObjectValue:&objectValue forString:newContents errorDescription:NULL];
if (result) ASSIGN (_objectValue, objectValue);
// Smartsoft End
_cell.has_valid_object_value = YES;
}
else
{
_cell.has_valid_object_value = NO;
}
}

ASSIGN (_contents, newContents);
}

Regards,

Andreas

reply via email to

[Prev in Thread] Current Thread [Next in Thread]