mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 562661 - [@ nsNavHistory::RowToResult] mishandles *aResult, r=mak
This commit is contained in:
parent
e210bb59d7
commit
829a61037f
@ -6873,8 +6873,8 @@ nsNavHistory::RowToResult(mozIStorageValueArray* aRow,
|
||||
nsNavHistoryQueryOptions* aOptions,
|
||||
nsNavHistoryResultNode** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
NS_ASSERTION(aRow && aOptions && aResult, "Null pointer in RowToResult");
|
||||
*aResult = nsnull;
|
||||
|
||||
// URL
|
||||
nsCAutoString url;
|
||||
@ -6929,20 +6929,18 @@ nsNavHistory::RowToResult(mozIStorageValueArray* aRow,
|
||||
}
|
||||
|
||||
rv = QueryRowToResult(itemId, url, title, accessCount, time, favicon, aResult);
|
||||
|
||||
// If it's a simple folder node (i.e. a shortcut to another folder), apply
|
||||
// our options for it. However, if the parent type was tag query, we do not
|
||||
// apply them, because it would not yield any results.
|
||||
if (*aResult && (*aResult)->IsFolder() &&
|
||||
aOptions->ResultType() !=
|
||||
nsINavHistoryQueryOptions::RESULTS_AS_TAG_QUERY)
|
||||
(*aResult)->GetAsContainer()->mOptions = aOptions;
|
||||
|
||||
// RESULTS_AS_TAG_QUERY has date columns
|
||||
NS_ENSURE_STATE(*aResult);
|
||||
if (aOptions->ResultType() == nsNavHistoryQueryOptions::RESULTS_AS_TAG_QUERY) {
|
||||
// RESULTS_AS_TAG_QUERY has date columns
|
||||
(*aResult)->mDateAdded = aRow->AsInt64(kGetInfoIndex_ItemDateAdded);
|
||||
(*aResult)->mLastModified = aRow->AsInt64(kGetInfoIndex_ItemLastModified);
|
||||
}
|
||||
else if ((*aResult)->IsFolder()) {
|
||||
// If it's a simple folder node (i.e. a shortcut to another folder), apply
|
||||
// our options for it. However, if the parent type was tag query, we do not
|
||||
// apply them, because it would not yield any results.
|
||||
(*aResult)->GetAsContainer()->mOptions = aOptions;
|
||||
}
|
||||
|
||||
return rv;
|
||||
} else if (aOptions->ResultType() == nsNavHistoryQueryOptions::RESULTS_AS_URI ||
|
||||
|
Loading…
Reference in New Issue
Block a user