nsIPresShell* pres; pres = doc->GetShellAt(0);
nsCOMPtr<nsIPresShell> pres; doc->GetShellAt(0, getter_AddRefs(pres));
nsDocLoaderImpl::GetContentViewerContainer(PRUint32 aDocumentID,                                           nsIContentViewerContainer** aResult){  nsISupports* base = (nsISupports*) aDocumentID;  nsIDocument* doc;  nsresult rv;  rv = base->QueryInterface(kIDocumentIID, (void**)&doc);  if (NS_SUCCEEDED(rv)) {    nsIPresShell* pres;    pres = doc->GetShellAt(0);    if (nsnull != pres) {      nsIPresContext* presContext;      rv = pres->GetPresContext(&presContext);      if (NS_SUCCEEDED(rv) && nsnull != presContext) {        nsISupports* supp;        rv = presContext->GetContainer(&supp);        if (NS_SUCCEEDED(rv) && nsnull != supp) {                    rv = supp->QueryInterface(kIContentViewerContainerIID, (void**)aResult);                    NS_RELEASE(supp);        }        NS_RELEASE(presContext);      }      NS_RELEASE(pres);    }    NS_RELEASE(doc);  }  return rv;}