From 2bdf4ab6e698fa86afcff35d99a92466c1d5fb96 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 29 Jul 2003 06:04:46 +0000 Subject: [PATCH] This should be that last of the nsIContent stuff for now. --- camino/src/bookmarks/BookmarksDataSource.mm | 5 ++--- camino/src/bookmarks/BookmarksMenu.mm | 6 ++---- camino/src/bookmarks/BookmarksService.mm | 11 ++++------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/camino/src/bookmarks/BookmarksDataSource.mm b/camino/src/bookmarks/BookmarksDataSource.mm index 056eb8f8ce2..284d24fc5af 100644 --- a/camino/src/bookmarks/BookmarksDataSource.mm +++ b/camino/src/bookmarks/BookmarksDataSource.mm @@ -132,8 +132,7 @@ const int kBookmarksRootItemTag = -2; if (!content) return; - nsCOMPtr parentContent; - content->GetParent(getter_AddRefs(parentContent)); + nsCOMPtr parentContent = content->GetParent(); nsCOMPtr root; BookmarksService::GetRootContent(getter_AddRefs(root)); @@ -483,7 +482,7 @@ const int kBookmarksRootItemTag = -2; nsCOMPtr parent; if (item) - item->GetParent(getter_AddRefs(parent)); + parent = item->GetParent(); if (parent) // we're not the root bmItem = [[BookmarksManager sharedBookmarksManager] getWrapperForContent:item]; diff --git a/camino/src/bookmarks/BookmarksMenu.mm b/camino/src/bookmarks/BookmarksMenu.mm index c06341af34d..820e9eb6720 100644 --- a/camino/src/bookmarks/BookmarksMenu.mm +++ b/camino/src/bookmarks/BookmarksMenu.mm @@ -146,11 +146,10 @@ - (NSMenu*)locateMenuForContent:(nsIContent*)content { - nsCOMPtr parent; if (content == mRootContent) return mMenu; - content->GetParent(getter_AddRefs(parent)); + nsCOMPtr parent = content->GetParent(); if (!parent) return nil; // not in our subtree @@ -215,8 +214,7 @@ BookmarkItem* bmItem = [bmManager getWrapperForContent:bookmark]; // XXX fix to not use nsIContent - nsCOMPtr parent; - bookmark->GetParent(getter_AddRefs(parent)); + nsCOMPtr parent = bookmark->GetParent(); NSMenu* menu = [self locateMenuForContent:parent]; if (!menu) return; diff --git a/camino/src/bookmarks/BookmarksService.mm b/camino/src/bookmarks/BookmarksService.mm index 5190c63cad2..c951aeaf714 100644 --- a/camino/src/bookmarks/BookmarksService.mm +++ b/camino/src/bookmarks/BookmarksService.mm @@ -1293,8 +1293,7 @@ BookmarksService::DoAncestorsIncludeNode(BookmarkItem* bookmark, BookmarkItem* s return true; // If a match wasn't found, set up the next node to compare - nsCOMPtr oldCurrent = current; - oldCurrent->GetParent(getter_AddRefs(current)); + current = current->GetParent(); } return false; @@ -1383,8 +1382,7 @@ BookmarksService::IsBookmarkDropValid(BookmarkItem* proposedParent, int index, N if (!isCopy && [draggedItems count] == 1) { BookmarkItem* draggedItem = [draggedItems objectAtIndex:0]; - nsCOMPtr parentContent; - [draggedItem contentNode]->GetParent(getter_AddRefs(parentContent)); + nsCOMPtr parentContent = [draggedItem contentNode]->GetParent(); PRInt32 childIndex; if (parentContent && NS_SUCCEEDED(parentContent->IndexOf([draggedItem contentNode], childIndex))) { @@ -1449,7 +1447,7 @@ BookmarksService::PerformBookmarkDrop(BookmarkItem* parent, BookmarkItem* before // get the dragged nodes parent nsCOMPtr draggedParent; if (draggedNode) - draggedNode->GetParent(getter_AddRefs(draggedParent)); + draggedParent = draggedNode->GetParent(); // get the proposed parent nsCOMPtr proposedParent = [parent contentNode]; @@ -1721,8 +1719,7 @@ BookmarksService::PerformURLDrop(BookmarkItem* parentItem, BookmarkItem* beforeI - (BookmarkItem*)parentItem { - nsCOMPtr parentContent; - mContentNode->GetParent(getter_AddRefs(parentContent)); + nsCOMPtr parentContent = mContentNode->GetParent(); nsCOMPtr rootContent; BookmarksService::GetRootContent(getter_AddRefs(rootContent));