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

version 1.21, 2002/04/17 07:38:31 version 1.22, 2002/04/17 08:31:11
Line 405  nsIDocument* BookmarksService::gBookmark Line 405  nsIDocument* BookmarksService::gBookmark
 NSMutableDictionary* BookmarksService::gDictionary = nil;  NSMutableDictionary* BookmarksService::gDictionary = nil;
 MainController* BookmarksService::gMainController = nil;  MainController* BookmarksService::gMainController = nil;
 NSMenu* BookmarksService::gBookmarksMenu = nil;  NSMenu* BookmarksService::gBookmarksMenu = nil;
   nsIDOMElement* BookmarksService::gToolbarRoot = nsnull;
 nsIAtom* BookmarksService::gFolderAtom = nsnull;  nsIAtom* BookmarksService::gFolderAtom = nsnull;
 nsIAtom* BookmarksService::gBookmarkAtom = nsnull;  nsIAtom* BookmarksService::gBookmarkAtom = nsnull;
 nsIAtom* BookmarksService::gHrefAtom = nsnull;  nsIAtom* BookmarksService::gHrefAtom = nsnull;
Line 632  BookmarksService::FlushBookmarks() Line 633  BookmarksService::FlushBookmarks()
     domSerializer->SerializeToStream(domDoc, outputStream, nsnull);      domSerializer->SerializeToStream(domDoc, outputStream, nsnull);
 }  }
   
voidvoid BookmarksService::EnsureToolbarRoot()
BookmarksService::ConstructBookmarksToolbar() 
 {  {
     if (gToolbarRoot)
       return;
   
   nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(gBookmarks));    nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(gBookmarks));
  nsCOMPtr<nsIDOMElement> toolbarRoot;  nsCOMPtr<nsIDOMElement> rootElt;
  domDoc->GetElementById(NS_LITERAL_STRING("toolbar"), getter_AddRefs(toolbarRoot));  domDoc->GetDocumentElement(getter_AddRefs(rootElt));
       
     nsCOMPtr<nsIDOMNode> child;
     rootElt->GetFirstChild(getter_AddRefs(child));
     nsAutoString typeValue;
     while (child) {
       nsCOMPtr<nsIDOMElement> childElt(do_QueryInterface(child));
       if (childElt) {
         childElt->GetAttribute(NS_LITERAL_STRING("type"), typeValue);
         if (typeValue.Equals(NS_LITERAL_STRING("toolbar")))
           gToolbarRoot = childElt;
       }
       
       nsCOMPtr<nsIDOMNode> temp;
       child->GetNextSibling(getter_AddRefs(temp));
       child = temp;
     }
   
     if (!gToolbarRoot) {
       printf("Repairing personal toolbar.\n");
       nsCOMPtr<nsIDOMElement> elt;
       domDoc->CreateElementNS(NS_LITERAL_STRING("http://chimera.mozdev.org/bookmarks/"),
                               NS_LITERAL_STRING("folder"),
                               getter_AddRefs(elt));
   
       elt->SetAttribute(NS_LITERAL_STRING("name"), NS_LITERAL_STRING("Toolbar Bookmarks"));
       elt->SetAttribute(NS_LITERAL_STRING("type"), NS_LITERAL_STRING("toolbar"));
   
       nsCOMPtr<nsIDOMNode> dummy;
       rootElt->AppendChild(elt, getter_AddRefs(dummy));
       gToolbarRoot = elt;
     }
 }  }
   
 void  void

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


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