Correction for bug which was allowing an entire menu to be dragged into an existing one. This caused an issue.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18885 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-03-24 20:22:39 +00:00
parent 50f9c1a097
commit 772c73fc2c

View file

@ -811,6 +811,19 @@ void _attachAll(NSMenu *menu, id document)
items = [document pasteType: IBMenuPboardType
fromPasteboard: dragPb
parent: edited];
// Test to see if the first item is a menu, if so reject the drag. If the
// first item is a menu item, accept it.
if([items count] > 0)
{
id itemZero = [items objectAtIndex: 0];
if([itemZero isKindOfClass: [NSMenu class]])
{
return NO;
}
}
// enumerate through the items and add them.
enumerator = [items objectEnumerator];
while ((item = [enumerator nextObject]) != nil)
{