if(NS_SUCCEEDED(mDocumentURL->QueryInterface(nsIURL::GetIID(),(void **)&pURL))){
if(NS_SUCCEEDED(mDocumentURL->QueryInterface(NS_GET_IID(nsIURL),(void **)&pURL))){
nsresult nsImageDocument::UpdateTitle( void ){  nsString titleStr;#ifdef USE_EXTENSION_FOR_TYPE  // XXX TEMPORARY XXX  // We want to display the image type, however there is no way to right now  // so instead we just get the image-extension  //  - get the URL interface, get the extension, convert to upper-case  //  Unless the Imagerequest or Image can tell us the type this is the best we can do.  nsIURL *pURL=nsnull;  if(NS_SUCCEEDED(mDocumentURL->QueryInterface(nsIURL::GetIID(),(void **)&pURL))){    char *pExtension=nsnull;    pURL->GetFileExtension(&pExtension);    if(pExtension){      nsString strExt; strExt.AssignWithConversion(pExtension);      strExt.ToUpperCase();      titleStr.Append(strExt);      nsCRT::free(pExtension);      pExtension=nsnull;    }    NS_IF_RELEASE(pURL);  }#endif  // append the image information...  titleStr.AppendWithConversion( " Image" );  if (mImageRequest) {    PRUint32 width, height;    mImageRequest->GetNaturalDimensions(&width, &height);    // if we got a valid size (sometimes we do not) then display it    if (width != 0 && height != 0){      titleStr.AppendWithConversion( " " );      titleStr.AppendInt((PRInt32)width);      titleStr.AppendWithConversion("x");      titleStr.AppendInt((PRInt32)height);      titleStr.AppendWithConversion(" pixels");    }  }   // set it on the document  SetTitle(titleStr);  return NS_OK;}