Bug 325763 r=annie.sullivan Remove calls to IsVoid, fix void handling

This commit is contained in:
brettw%gmail.com 2006-02-08 02:12:23 +00:00
parent 115c18b945
commit 44b42c8a97
2 changed files with 5 additions and 20 deletions

View File

@ -1196,10 +1196,7 @@ nsNavBookmarks::GetItemTitle(nsIURI *aURI, nsAString &aTitle)
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;
return statement->GetString(nsNavHistory::kGetInfoIndex_Title, aTitle);
}
NS_IMETHODIMP

View File

@ -2999,11 +2999,12 @@ nsNavHistory::RowToResult(mozIStorageValueArray* aRow,
// title
nsCAutoString title;
title.SetIsVoid(PR_TRUE);
if (! aOptions->ForceOriginalTitle()) {
rv = aRow->GetUTF8String(kGetInfoIndex_UserTitle, title);
NS_ENSURE_SUCCESS(rv, rv);
}
if (title.IsEmpty()) {
if (title.IsVoid()) {
rv = aRow->GetUTF8String(kGetInfoIndex_Title, title);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -3244,25 +3245,12 @@ nsNavHistory::SetPageTitleInternal(nsIURI* aURI, PRBool aIsUserTitle,
}
// page title
PRInt32 titleType;
rv = mDBGetURLPageInfo->GetTypeOfIndex(kGetInfoIndex_Title, &titleType);
rv = mDBGetURLPageInfo->GetString(kGetInfoIndex_Title, title);
NS_ENSURE_SUCCESS(rv, rv);
if (titleType == mozIStorageValueArray::VALUE_TYPE_NULL) {
title.SetIsVoid(PR_TRUE);
} else {
rv = mDBGetURLPageInfo->GetString(kGetInfoIndex_Title, title);
NS_ENSURE_SUCCESS(rv, rv);
}
// user title
rv = mDBGetURLPageInfo->GetTypeOfIndex(kGetInfoIndex_UserTitle, &titleType);
rv = mDBGetURLPageInfo->GetString(kGetInfoIndex_UserTitle, userTitle);
NS_ENSURE_SUCCESS(rv, rv);
if (titleType == mozIStorageValueArray::VALUE_TYPE_NULL) {
userTitle.SetIsVoid(PR_TRUE);
} else {
rv = mDBGetURLPageInfo->GetString(kGetInfoIndex_UserTitle, userTitle);
NS_ENSURE_SUCCESS(rv, rv);
}
}
// It is actually common to set the title to be the same thing it used to