Fix bad getters on nsIDocument and nsIScriptContext to use out params rather than return |AddRef|ed pointers. b=81289 r=jaggernaut sr=jst a=asa

git-svn-id: svn://10.0.0.236/trunk@97540 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2001-06-20 03:27:48 +00:00
parent 66fdbe996f
commit 88810ef1eb
120 changed files with 655 additions and 495 deletions

View File

@@ -121,13 +121,13 @@ nsresult
nsContentUtils::GetDynamicScriptGlobal(JSContext* aContext,
nsIScriptGlobalObject** aNativeGlobal)
{
nsIScriptGlobalObject* nativeGlobal = nsnull;
nsCOMPtr<nsIScriptContext> scriptCX;
GetDynamicScriptContext(aContext, getter_AddRefs(scriptCX));
if (scriptCX) {
*aNativeGlobal = nativeGlobal = scriptCX->GetGlobalObject();
if (!scriptCX) {
*aNativeGlobal = nsnull;
return NS_ERROR_FAILURE;
}
return nativeGlobal ? NS_OK : NS_ERROR_FAILURE;
return scriptCX->GetGlobalObject(aNativeGlobal);
}
//static
@@ -451,7 +451,8 @@ nsContentUtils::ReparentContentWrapper(nsIContent *aContent,
nsCOMPtr<nsISupports> new_parent;
if (!aNewParent) {
nsCOMPtr<nsIContent> root(dont_AddRef(old_doc->GetRootContent()));
nsCOMPtr<nsIContent> root;
old_doc->GetRootContent(getter_AddRefs(root));
if (root.get() == aContent) {
new_parent = old_doc;