diff --git a/ChangeLog b/ChangeLog index 99c509b69..a0dfde834 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-09-13 Gregory John Casamento + + * Source/NSPopUpButtonCell.m: Corrected minor problem which + was causing a compilation error. + 2003-09-13 Fred Kiefer * Source/NSMenu.m @@ -7,7 +12,8 @@ Undid last change. Rewrote [setMenu:] to make the popup button cell listen to change notifications of the menu. New method [itemChanged:] gets called when a menu item changes. Added hack to - [initWithCoder:] to set menu correctly and read old menu items correctly. + [initWithCoder:] to set menu correctly and read old menu items + correctly. Check in [itemAtIndex:] that the index is vaild and return nil otherwise. diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index a9f871a3e..73b14c411 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -353,7 +353,7 @@ static NSImage *_pbc_image[2]; } else { - retun nil; + return nil; } } diff --git a/Source/NSToolbar.m b/Source/NSToolbar.m index 89eac6c5c..f4d53edc7 100644 --- a/Source/NSToolbar.m +++ b/Source/NSToolbar.m @@ -183,10 +183,19 @@ static const int current_version = 1; } } - - (id) initWithIdentifier: (NSString*)identifier { [super init]; + + _customizationPaletteIsRunning = NO; + _allowsUserCustomization = NO; + _autosavesConfiguration = NO; + _configurationDictionary = nil; + _delegate = nil; + _displayMode = NSToolbarDisplayModeDefault; + _visible = YES; + _items = nil; + _visibleItems = nil; ASSIGN(_identifier, identifier); [self _loadConfig]; @@ -211,12 +220,17 @@ static const int current_version = 1; - (void) insertItemWithItemIdentifier: (NSString *)itemIdentifier atIndex: (int)index { - NSToolbarItem *item = [_delegate toolbar: self - itemForItemIdentifier: itemIdentifier - willBeInsertedIntoToolbar: YES]; - [nc postNotificationName: NSToolbarWillAddItemNotification - object: self]; - [_items insertObject: item atIndex: index]; + NSToolbarItem *item = nil; + NSArray *allowedItems = [_delegate toolbarAllowedItemIdentifiers: self]; + if([allowedItems containsObject: itemIdentifier]) + { + item = [_delegate toolbar: self + itemForItemIdentifier: itemIdentifier + willBeInsertedIntoToolbar: YES]; + [nc postNotificationName: NSToolbarWillAddItemNotification + object: self]; + [_items insertObject: item atIndex: index]; + } } - (BOOL) isVisible @@ -243,6 +257,10 @@ static const int current_version = 1; { _customizationPaletteIsRunning = [NSBundle loadNibNamed: @"GSToolbarCustomizationPalette" owner: self]; + if(!_customizationPaletteIsRunning) + { + NSLog(@"Failed to load gorm for GSToolbarCustomizationPalette"); + } } - (void) setAllowsUserCustomization: (BOOL)flag