QI instead of casting so JS-implemented results work right. Bug 344939, patch

by Pawel Chmielowski <prefiks@aviary.pl>, r=enndeakin, sr=bzbarsky
This commit is contained in:
bzbarsky%mit.edu 2006-07-18 00:21:00 +00:00
Родитель 9aab7b5b89
Коммит 60b1e59483
2 изменённых файлов: 14 добавлений и 6 удалений

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

@ -1280,12 +1280,16 @@ nsXULContentBuilder::CreateContainerContentsForQuerySet(nsIContent* aElement,
rv = results->HasMoreElements(&hasMoreResults);
for (; NS_SUCCEEDED(rv) && hasMoreResults;
rv = results->HasMoreElements(&hasMoreResults)){
nsCOMPtr<nsIXULTemplateResult> nextresult;
rv = results->GetNext(getter_AddRefs(nextresult));
rv = results->HasMoreElements(&hasMoreResults)) {
nsCOMPtr<nsISupports> nr;
rv = results->GetNext(getter_AddRefs(nr));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIXULTemplateResult> nextresult = do_QueryInterface(nr);
if (!nextresult)
return NS_ERROR_UNEXPECTED;
nsCOMPtr<nsIRDFResource> resultid;
rv = GetResultResource(nextresult, getter_AddRefs(resultid));
if (NS_FAILED(rv))

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

@ -1587,12 +1587,16 @@ nsXULTreeBuilder::OpenSubtreeForQuerySet(nsTreeRows::Subtree* aSubtree,
rv = results->HasMoreElements(&hasMoreResults);
for (; NS_SUCCEEDED(rv) && hasMoreResults;
rv = results->HasMoreElements(&hasMoreResults)){
nsCOMPtr<nsIXULTemplateResult> nextresult;
rv = results->GetNext(getter_AddRefs(nextresult));
rv = results->HasMoreElements(&hasMoreResults)) {
nsCOMPtr<nsISupports> nr;
rv = results->GetNext(getter_AddRefs(nr));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIXULTemplateResult> nextresult = do_QueryInterface(nr);
if (!nextresult)
return NS_ERROR_UNEXPECTED;
nsCOMPtr<nsIRDFResource> resultid;
rv = GetResultResource(nextresult, getter_AddRefs(resultid));
if (NS_FAILED(rv))