From 73fd0482a861d699da19fbdfdab5e710d1ec8bd0 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Sat, 21 Aug 2004 10:06:24 +0000 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ Source/NSComboBoxCell.m | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index eba01002c..d788bcd73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-08-21 Fred Kiefer + + * Source/NSComboBoxCell.m (-completedString:): Handle a nil + substring by returning nil directly without trying to find a + match. Patch by Andreas Hoeschler . + Changed data source error messages to consistent wording. + 2004-08-13 Quentin Mathe * Source/NSComboBoxCell.m: diff --git a/Source/NSComboBoxCell.m b/Source/NSComboBoxCell.m index 3ba9d4e89..ce4809538 100644 --- a/Source/NSComboBoxCell.m +++ b/Source/NSComboBoxCell.m @@ -980,7 +980,7 @@ numberOfRowsInColumn: (int)column { if (!_dataSource) { - NSLog(@"%@: A DataSource should be specified", self); + NSLog(@"%@: No data source currently specified", self); } else { @@ -1287,10 +1287,17 @@ numberOfRowsInColumn: (int)column */ - (NSString *)completedString:(NSString *)substring { + if (nil == substring) + { + return nil; + } + if (_usesDataSource) { if (!_dataSource) - NSLog(@"%@: A data source should be specified", self); + { + NSLog(@"%@: No data source currently specified", self); + } else if ([_dataSource respondsToSelector: @selector(comboBox:completedString:)]) { return [_dataSource comboBox: (NSComboBox *)[self controlView] @@ -1837,7 +1844,7 @@ static inline NSRect buttonCellFrameFromRect(NSRect cellRect) { if (!_dataSource) { - NSLog(@"%@: A DataSource should be specified", self); + NSLog(@"%@: No data source currently specified", self); } else {