Fix bug 293147: when copying a bookmarks folder, don't propagate the dock menu flag. Patch by englabenny@macnytt.com.

This commit is contained in:
smfr%smfr.org 2005-06-24 02:30:03 +00:00
parent f50615aecb
commit 8fa9b149b7

View File

@ -92,20 +92,24 @@ NSString* const BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc";
{
if ([self isSmartFolder])
return nil;
id doppleganger = [super copyWithZone:zone];
[doppleganger setSpecialFlag:[self specialFlag]];
id folderCopy = [super copyWithZone:zone];
unsigned folderFlags = ([self specialFlag] & ~kBookmarkDockMenuFolder); // don't copy dock menu flag
[folderCopy setSpecialFlag:folderFlags];
NSEnumerator *enumerator = [[self childArray] objectEnumerator];
id anItem, aCopiedItem;
//head fake the undomanager
// head fake the undomanager
NSUndoManager *undoManager = [[BookmarkManager sharedBookmarkManager] undoManager];
[undoManager disableUndoRegistration];
while ((anItem = [enumerator nextObject])) {
aCopiedItem = [anItem copyWithZone:[anItem zone]];
[doppleganger insertChild:aCopiedItem];
[folderCopy insertChild:aCopiedItem];
[aCopiedItem release];
}
[undoManager enableUndoRegistration];
return doppleganger;
return folderCopy;
}
-(void)dealloc