GSToolbarCustomizationView needs to retain its list of palette items.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31562 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2010-10-26 00:13:20 +00:00
parent 7938a855d3
commit 9915a56da3
2 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2010-10-25 Doug Simons <doug.simons@testplant.com>
* Source/GSToolbarCustomizationPalette.m:
GSToolbarCustomizationView needs to retain its list of palette items.
2010-10-24 Riccardo Mottola
* Source/NSTextView.m

View file

@ -44,6 +44,7 @@
/* Customization View */
@interface GSToolbarCustomizationView : NSView
{
NSArray *_paletteItems;
}
- (void) setToolbarItems: (NSArray *)items;
@ -54,6 +55,12 @@
@implementation GSToolbarCustomizationView
- (void)dealloc
{
[_paletteItems release];
[super dealloc];
}
/* If the toolbar item has a custom view and the item is in use in the
toolbar, this view has already a superview. We need to make a copy of it
in order to be able to put it in the customization view.
@ -147,10 +154,11 @@
- (void) setToolbarItems: (NSArray *)items
{
NSArray *paletteItems = [self paletteItemsWithToolbarItems: items];
NSEnumerator *e;
NSView *itemView;
NSToolbarItem *item;
[_paletteItems release];
_paletteItems = [[self paletteItemsWithToolbarItems: items] retain];
// Remove all old subviews
e = [[self subviews] objectEnumerator];
@ -160,8 +168,8 @@
}
NSDebugLLog(DEBUG_LEVEL, @"Will insert the views of toolbar items %@ in \
customization view", paletteItems);
e = [paletteItems objectEnumerator];
customization view", _paletteItems);
e = [_paletteItems objectEnumerator];
while ((item = [e nextObject]) != nil)
{
itemView = [item _backView];