From 04ab4d43923b59cb0e9c17a8700b0761d92b720f Mon Sep 17 00:00:00 2001 From: gcasa Date: Fri, 20 Feb 2009 17:22:22 +0000 Subject: [PATCH] Correction for toolbar customization palette not showing when standard elements are included. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27929 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/GSToolbarCustomizationPalette.m | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca003c199..bc180b3fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-20 12:08-EST Gregory John Casamento + + * Source/GSToolbarCustomizationPalette.m: Look up default items before + calling the delegate like in NSToolbar.m. This was causing an + exception which prevented the panel from showing. + 2009-02-18 Richard Frith-Macdonald * Source/GSServicesManager.m: Clean up update of services menu, diff --git a/Source/GSToolbarCustomizationPalette.m b/Source/GSToolbarCustomizationPalette.m index a37fbed52..7f5950616 100644 --- a/Source/GSToolbarCustomizationPalette.m +++ b/Source/GSToolbarCustomizationPalette.m @@ -254,18 +254,28 @@ e = [itemIdentifiers objectEnumerator]; while ((identifier = [e nextObject]) != nil) { - [_allowedItems addObject: [delegate toolbar: toolbar - itemForItemIdentifier: identifier - willBeInsertedIntoToolbar: NO]]; + NSToolbarItem *item = [toolbar _toolbarItemForIdentifier: identifier]; + if(item == nil) + { + item = [delegate toolbar: toolbar + itemForItemIdentifier: identifier + willBeInsertedIntoToolbar: NO]; + } + [_allowedItems addObject: item]; } itemIdentifiers = [delegate toolbarDefaultItemIdentifiers: toolbar]; e = [itemIdentifiers objectEnumerator]; while ((identifier = [e nextObject]) != nil) { - [_defaultItems addObject: [delegate toolbar: toolbar - itemForItemIdentifier: identifier - willBeInsertedIntoToolbar: NO]]; + NSToolbarItem *item = [toolbar _toolbarItemForIdentifier: identifier]; + if(item == nil) + { + item = [delegate toolbar: toolbar + itemForItemIdentifier: identifier + willBeInsertedIntoToolbar: NO]; + } + [_defaultItems addObject: item]; } [_customizationView setToolbarItems: _allowedItems];