nsDocument_cpp-shell-manual-rewrite
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 141 52d0962c5ed54343d40b33029489225eec95495b
permissions -rw-r--r--
State as of now

diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -1884,8 +1884,8 @@ nsDocument::doCreateShell(nsPresContext*
 
   FillStyleSet(aStyleSet);
   
-  nsCOMPtr<nsIPresShell> shell;
-  nsresult rv = NS_NewPresShell(getter_AddRefs(shell));
+  nsIPresShell* shell = nsnull;
+  nsresult rv = NS_NewPresShell(&shell);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -1896,7 +1896,7 @@ nsDocument::doCreateShell(nsPresContext*
   // Note: we don't hold a ref to the shell (it holds a ref to us)
   NS_ENSURE_TRUE(mPresShells.AppendElementUnlessExists(shell),
                  NS_ERROR_OUT_OF_MEMORY);
-  shell.swap(*aInstancePtrResult);
+  *aInstancePtrResult = shell;
 
   return NS_OK;
 }