GetTitle( titleStr );
nsIURL *pURL=nsnull; if(NS_SUCCEEDED(mDocumentURL->QueryInterface(nsIURL::GetIID(),(void **)&pURL))){ char *pExtension=nsnull; pURL->GetFileExtension(&pExtension); if(pExtension){ nsString strExt(pExtension); strExt.ToUpperCase(); titleStr.Append(strExt); nsCRT::free(pExtension); pExtension=nsnull; } NS_IF_RELEASE(pURL); }
nsresult nsImageDocument::UpdateTitle( void ){  nsString titleStr;  // get the title from the Document (in case there was a previously set title )  GetTitle( titleStr );  // append the image information...  titleStr.Append( "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.Append( " " );      titleStr.Append((PRInt32)width);      titleStr.Append("x");      titleStr.Append((PRInt32)height);      titleStr.Append(" pixels");    }  }   // set it on the document  SetTitle(titleStr);  return NS_OK;}