Fixed a bug in NSPopUpButtonCell - see the ChangeLog for details.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17418 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Ludovic Marcotte 2003-08-02 14:55:30 +00:00
parent 8b09ec55a8
commit 45fdc0cdfa
2 changed files with 12 additions and 2 deletions

View file

@ -200,14 +200,17 @@ static NSImage *_pbc_image[2];
- (void) insertItemWithTitle: (NSString *)title atIndex: (int)index
{
id <NSMenuItem> anItem;
int count = [_menu numberOfItems];
int i = [self indexOfItemWithTitle: title];
int i, count;
i = [self indexOfItemWithTitle: title];
if (-1 != i)
{
[self removeItemAtIndex: i];
}
count = [_menu numberOfItems];
if (index < 0)
index = 0;
if (index > count)