From c758727ee0cd0ec2e85a073d24311a5fcc8384ff Mon Sep 17 00:00:00 2001 From: ludovic Date: Sat, 2 Aug 2003 14:55:30 +0000 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ Source/NSPopUpButtonCell.m | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 906fd06f0..c49f0e938 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-08-02 Ludovic Marcotte * Documentation/GNUmakefile.postamble (after-install): Install diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 10ca475d5..6629cd91b 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -200,14 +200,17 @@ static NSImage *_pbc_image[2]; - (void) insertItemWithTitle: (NSString *)title atIndex: (int)index { id 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)