Diff for /chimera/BookmarksService.mm between versions 1.30 and 1.31

version 1.30, 2002/04/20 00:44:56 version 1.31, 2002/04/20 01:18:54
Line 912  BookmarksService::AddMenuBookmark(NSMenu Line 912  BookmarksService::AddMenuBookmark(NSMenu
   nsCOMPtr<nsIAtom> tagName;    nsCOMPtr<nsIAtom> tagName;
   aChild->GetTag(*getter_AddRefs(tagName));    aChild->GetTag(*getter_AddRefs(tagName));
   
  if (tagName == gFolderAtom) {  nsAutoString group;
   nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aChild));
   elt->GetAttribute(NS_LITERAL_STRING("group"), group);
   
   if (group.IsEmpty() && tagName == gFolderAtom) {
     NSMenu* menu = [[[NSMenu alloc] initWithTitle: title] autorelease];      NSMenu* menu = [[[NSMenu alloc] initWithTitle: title] autorelease];
     [aMenu setSubmenu: menu forItem: menuItem];      [aMenu setSubmenu: menu forItem: menuItem];
     [menu setAutoenablesItems: NO];      [menu setAutoenablesItems: NO];
Line 931  BookmarksService::AddMenuBookmark(NSMenu Line 935  BookmarksService::AddMenuBookmark(NSMenu
 void   void 
 BookmarksService::OpenMenuBookmark(BrowserWindowController* aController, id aMenuItem)  BookmarksService::OpenMenuBookmark(BrowserWindowController* aController, id aMenuItem)
 {  {
    // Get the corresponding bookmark item.  // Get the corresponding bookmark item.
    BookmarkItem* item = [gDictionary objectForKey: [NSNumber numberWithInt: [aMenuItem tag]]];  BookmarkItem* item = [gDictionary objectForKey: [NSNumber numberWithInt: [aMenuItem tag]]];
        
    // Get the content node.  // Get the content node.
    nsIContent* content = [item contentNode];  nsIContent* content = [item contentNode];
          nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(content));
    // Get the href attribute.  This is the URL we want to load.  nsAutoString group;
    nsAutoString href;  elt->GetAttribute(NS_LITERAL_STRING("group"), group);
    content->GetAttr(kNameSpaceID_None, gHrefAtom, href);  if (!group.IsEmpty())
    nsCAutoString cref; cref.AssignWithConversion(href);    return OpenBookmarkGroup([aController getTabBrowser], elt);
    if (cref.IsEmpty())  
        return;  // Get the href attribute.  This is the URL we want to load.
          nsAutoString href;
    NSString* url = [NSString stringWithCString: cref.get()];  content->GetAttr(kNameSpaceID_None, gHrefAtom, href);
      nsCAutoString cref; cref.AssignWithConversion(href);
    // Now load the URL in the window.  if (cref.IsEmpty())
    [aController loadURL:[NSURL URLWithString: url]];    return;
    
    // Focus and activate our content area.  NSString* url = [NSString stringWithCString: cref.get()];
    [[[aController getMyBrowserView] getBrowserView] setActive: YES];
   // Now load the URL in the window.
   [aController loadURL:[NSURL URLWithString: url]];
 
   // Focus and activate our content area.
   [[[aController getMyBrowserView] getBrowserView] setActive: YES];
 }  }
   
 void  void
Line 992  BookmarksService::OpenBookmarkGroup(id a Line 1001  BookmarksService::OpenBookmarkGroup(id a
     currentIndex++;      currentIndex++;
   }    }
   
  // XXXdwh Select and activate the first tab.  // Select and activate the first tab.
   [aTabView selectTabViewItemAtIndex: 0];
   [[[[aTabView tabViewItemAtIndex: 0] view] getBrowserView] setActive: YES];
 }  }

Removed from v.1.30  
changed lines
  Added in v.1.31


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