* Source/NSComboBoxCell.m (validateSelection): Test for invalid row.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23999 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ratmice 2006-10-30 20:25:50 +00:00
parent e110340902
commit 559565c463
2 changed files with 16 additions and 8 deletions

View file

@ -697,21 +697,25 @@ static GSComboWindow *gsWindow = nil;
{
NSText *textObject = nil;
id cv = [_cell controlView];
int index = [_cell indexOfSelectedItem];
if ([cv isKindOfClass: [NSControl class]])
{
textObject = [(NSControl *)cv currentEditor];
}
[_cell setStringValue: [_cell _stringValueAtIndex:
[_cell indexOfSelectedItem]]];
// Will update the editor when needed
if (index != -1)
{
[_cell setStringValue: [_cell _stringValueAtIndex:
[_cell indexOfSelectedItem]]];
// Will update the editor when needed
// FIXME: Because NSCell doesn't behave correctly the line just over has
// no effect, to correct this fact, the code below is needed.
[textObject setString: [_cell _stringValueAtIndex:
[_cell indexOfSelectedItem]]];
// End of the code to remove
// FIXME: Because NSCell doesn't behave correctly the line just over has
// no effect, to correct this fact, the code below is needed.
[textObject setString: [_cell _stringValueAtIndex:
[_cell indexOfSelectedItem]]];
// End of the code to remove
}
if (textObject != nil)
{