Fixed problem with retrieval of objects.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21661 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-08-19 03:24:23 +00:00
parent 4258edcf1c
commit 81ef7c4c41
2 changed files with 15 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2005-08-18 23:22 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocument.m: retrieveObjectForParent:.. check for
nil before placing in result array.
2005-08-18 22:21 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocument.m: attachObject:toParent: added code to

View file

@ -570,7 +570,10 @@ static NSImage *fileImage = nil;
else if([anObject isKindOfClass: [NSMenuItem class]])
{
NSMenu *menu = [(NSMenuItem *)anObject submenu];
[self attachObject: menu toParent: anObject];
if(menu != nil)
{
[self attachObject: menu toParent: anObject];
}
}
/*
* Add the current menu and any submenus.
@ -1176,10 +1179,13 @@ static NSImage *fileImage = nil;
while((con = [en nextObject]) != nil)
{
id obj = [con source];
[array addObject: obj];
if(flag)
if(obj != nil)
{
[self _retrieveObjectsForParent: obj intoArray: array recursively: flag];
[array addObject: obj];
if(flag)
{
[self _retrieveObjectsForParent: obj intoArray: array recursively: flag];
}
}
}
}