Deal with nil in substrign expansion.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19898 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2004-08-21 10:06:24 +00:00
parent 1fc2399220
commit 73fd0482a8
2 changed files with 17 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2004-08-21 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSComboBoxCell.m (-completedString:): Handle a nil
substring by returning nil directly without trying to find a
match. Patch by Andreas Hoeschler <ahoesch@smartsoft.de>.
Changed data source error messages to consistent wording.
2004-08-13 Quentin Mathe <qmathe@club-internet.fr> 2004-08-13 Quentin Mathe <qmathe@club-internet.fr>
* Source/NSComboBoxCell.m: * Source/NSComboBoxCell.m:

View file

@ -980,7 +980,7 @@ numberOfRowsInColumn: (int)column
{ {
if (!_dataSource) if (!_dataSource)
{ {
NSLog(@"%@: A DataSource should be specified", self); NSLog(@"%@: No data source currently specified", self);
} }
else else
{ {
@ -1287,10 +1287,17 @@ numberOfRowsInColumn: (int)column
*/ */
- (NSString *)completedString:(NSString *)substring - (NSString *)completedString:(NSString *)substring
{ {
if (nil == substring)
{
return nil;
}
if (_usesDataSource) if (_usesDataSource)
{ {
if (!_dataSource) if (!_dataSource)
NSLog(@"%@: A data source should be specified", self); {
NSLog(@"%@: No data source currently specified", self);
}
else if ([_dataSource respondsToSelector: @selector(comboBox:completedString:)]) else if ([_dataSource respondsToSelector: @selector(comboBox:completedString:)])
{ {
return [_dataSource comboBox: (NSComboBox *)[self controlView] return [_dataSource comboBox: (NSComboBox *)[self controlView]
@ -1837,7 +1844,7 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect)
{ {
if (!_dataSource) if (!_dataSource)
{ {
NSLog(@"%@: A DataSource should be specified", self); NSLog(@"%@: No data source currently specified", self);
} }
else else
{ {