Diff for /chimera/BookmarksService.mm between versions 1.22 and 1.23

version 1.22, 2002/04/17 08:31:11 version 1.23, 2002/04/17 22:57:07
Line 466  BookmarksService::LocateMenu(nsIContent* Line 466  BookmarksService::LocateMenu(nsIContent*
 {  {
   nsCOMPtr<nsIContent> parent;    nsCOMPtr<nsIContent> parent;
   aContent->GetParent(*getter_AddRefs(parent));    aContent->GetParent(*getter_AddRefs(parent));
  if (!parent)  if (!parent) {
     return BookmarksService::gBookmarksMenu;      return BookmarksService::gBookmarksMenu;
  }
   
   NSMenu* parentMenu = LocateMenu(parent);    NSMenu* parentMenu = LocateMenu(parent);
       
   PRUint32 contentID;    PRUint32 contentID;
   aContent->GetContentID(&contentID);    aContent->GetContentID(&contentID);
   
   NSMenuItem* childMenu = [parentMenu itemWithTag: contentID];    NSMenuItem* childMenu = [parentMenu itemWithTag: contentID];
  return [childMenu menu];  return [childMenu submenu];
 }  }
   
 void  void
Line 500  BookmarksService::BookmarkAdded(nsIConte Line 501  BookmarksService::BookmarkAdded(nsIConte
   
       [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];        [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];
     }      }
       else if (instance->mToolbar) {
         // We're a personal toolbar.
         nsCOMPtr<nsIDOMElement> parentElt(do_QueryInterface(aContainer));
         if (parentElt == gToolbarRoot) {
           // We only care about changes that occur to the personal toolbar's immediate
           // children.
           PRInt32 index = -1;
           aContainer->IndexOf(aChild, index);
           nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aChild));
           [(instance->mToolbar) addButton: elt atIndex: index];
         }
       }
     else {      else {
       // We're the menu.        // We're the menu.
       PRInt32 index = -1;        PRInt32 index = -1;
      aChild->IndexOf(aContainer, index);      aContainer->IndexOf(aChild, index);
       NSMenu* menu = LocateMenu(aContainer);        NSMenu* menu = LocateMenu(aContainer);
       AddMenuBookmark(menu, aContainer, aChild, index);        AddMenuBookmark(menu, aContainer, aChild, index);
     }      }
Line 553  BookmarksService::BookmarkRemoved(nsICon Line 566  BookmarksService::BookmarkRemoved(nsICon
   
       [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];        [(instance->mDataSource) reloadDataForItem: item reloadChildren: YES];
     }      }
       else if (instance->mToolbar) {
         // We're a personal toolbar.
         nsCOMPtr<nsIDOMElement> parentElt(do_QueryInterface(aContainer));
         if (parentElt == gToolbarRoot) {
           // We only care about changes that occur to the personal toolbar's immediate
           // children.
           nsCOMPtr<nsIDOMElement> childElt(do_QueryInterface(aChild));
           [(instance->mToolbar) removeButton: childElt];
         }
       }    
     else {      else {
       // We're the menu.        // We're the menu.
       NSMenu* menu = LocateMenu(aContainer);        NSMenu* menu = LocateMenu(aContainer);

Removed from v.1.22  
changed lines
  Added in v.1.23


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>