зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
9aab7b5b89
Коммит
60b1e59483
|
@ -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))
|
||||
|
|
Загрузка…
Ссылка в новой задаче