try to fix bugss in last change, Optimize in case of common string and check for nil.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27889 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rmottola 2009-02-16 21:40:26 +00:00
parent 9cf6a46575
commit 034643d0ce
2 changed files with 18 additions and 1 deletions

View file

@ -431,7 +431,19 @@ static NSColor *dtxtCol;
if (_formatter == nil)
{
[self setObjectValue: aString];
/* if we are a string, we do an optimization and set the value here instead of using setObjectValue
* also, we check for nil, since isKindOfClass fails for nil objects */
if([aString isKindOfClass: [NSString class]] == YES || aString == nil)
{
ASSIGN (_contents, aString);
ASSIGN (_object_value, aString);
_cell.has_valid_object_value = YES;
}
else
{
NSLog(@"not a string, setObjectValue: %@", aString);
[self setObjectValue: aString];
}
}
else
{