From 44b42c8a97c21497bc1d7c5242d0376aa87dbed4 Mon Sep 17 00:00:00 2001 From: "brettw%gmail.com" Date: Wed, 8 Feb 2006 02:12:23 +0000 Subject: [PATCH] Bug 325763 r=annie.sullivan Remove calls to IsVoid, fix void handling --- .../components/places/src/nsNavBookmarks.cpp | 5 +---- .../components/places/src/nsNavHistory.cpp | 20 ++++--------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/browser/components/places/src/nsNavBookmarks.cpp b/browser/components/places/src/nsNavBookmarks.cpp index 2134f9c5e31d..c22155150b2a 100644 --- a/browser/components/places/src/nsNavBookmarks.cpp +++ b/browser/components/places/src/nsNavBookmarks.cpp @@ -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 diff --git a/browser/components/places/src/nsNavHistory.cpp b/browser/components/places/src/nsNavHistory.cpp index 44f301bb7500..b9e19078ff73 100644 --- a/browser/components/places/src/nsNavHistory.cpp +++ b/browser/components/places/src/nsNavHistory.cpp @@ -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