Changed bookmarks set and get item title to use user titles instead of page titles. bug=320453 r=bryner keywords=fixed1.8.1

This commit is contained in:
annie.sullivan%gmail.com 2006-01-28 01:32:44 +00:00
Родитель 3a6c3608fe
Коммит b21001a184
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -1011,7 +1011,7 @@ nsNavBookmarks::GetChildFolder(PRInt64 aFolder, const nsAString& aSubFolder,
NS_IMETHODIMP
nsNavBookmarks::SetItemTitle(nsIURI *aURI, const nsAString &aTitle)
{
return History()->SetPageTitle(aURI, aTitle);
return History()->SetPageUserTitle(aURI, aTitle);
}
@ -1032,7 +1032,15 @@ nsNavBookmarks::GetItemTitle(nsIURI *aURI, nsAString &aTitle)
return NS_ERROR_INVALID_ARG;
}
return statement->GetString(nsNavHistory::kGetInfoIndex_Title, aTitle);
// First check for a user title
if (!statement->IsNull(nsNavHistory::kGetInfoIndex_UserTitle))
return statement->GetString(nsNavHistory::kGetInfoIndex_UserTitle, aTitle);
// If there is no user title, check for a history title.
rv = statement->GetString(nsNavHistory::kGetInfoIndex_Title, aTitle);
if (statement->IsNull(nsNavHistory::kGetInfoIndex_Title))
aTitle.SetIsVoid(PR_TRUE);
return rv;
}
NS_IMETHODIMP