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:
Riccardo Mottola 2009-02-16 21:40:26 +00:00
parent 67d368832d
commit f7403db91c
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2009-02-16 Riccardo Mottola <rmottola@users.sf.net>
* Source/NSCell.m (-setStringValue): Try to fix bugs in last change.
Optimize in case of common string and check for nil.
2009-02-16 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSCell.m (-setStringValue:, -setObjectValue:): Try to fix

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
{