--- chimera/NSBrowserView.mm 2002/03/06 00:30:35 1.24 +++ chimera/NSBrowserView.mm 2002/03/07 03:18:55 1.25 @@ -569,13 +569,11 @@ nsCocoaBrowserListener::OnLocationChange nsIRequest *aRequest, nsIURI *location) { - nsXPIDLCString spec; - - location->GetSpec(getter_Copies(spec)); - if (!spec) { + if (!location) return NS_ERROR_FAILURE; - } - + + nsCAutoString spec; + location->GetSpec(spec); const char* cstr = spec.get(); NSString* str = [NSString stringWithCString:cstr]; NSURL* url = [NSURL URLWithString:str]; @@ -759,11 +757,8 @@ void nsHeaderSniffer::PerformSave() if (defaultFileName.IsEmpty()) { nsCOMPtr url(do_QueryInterface(mURL)); - if (url) { - nsXPIDLCString fileName; - url->GetFileName(getter_Copies(fileName)); - defaultFileName = fileName; // (2) For file URLs, use the file name. - } + if (url) + url->GetFileName(defaultFileName); // (2) For file URLs, use the file name. } if (defaultFileName.IsEmpty() && mDocument && isHTML) { @@ -778,12 +773,9 @@ void nsHeaderSniffer::PerformSave() // (4) Use the caller provided name. XXXdwh } - if (defaultFileName.IsEmpty()) { + if (defaultFileName.IsEmpty()) // (5) Use the host. - nsXPIDLCString host; - mURL->GetHost(getter_Copies(host)); - defaultFileName = host; - } + mURL->GetHost(defaultFileName); // One last case to handle about:blank and other fruity untitled pages. if (defaultFileName.IsEmpty()) @@ -799,11 +791,10 @@ void nsHeaderSniffer::PerformSave() nsCOMPtr fileURL(do_QueryInterface(fileURI)); if (!fileURL) return; - fileURL->SetFilePath(defaultFileName.get()); + fileURL->SetFilePath(defaultFileName); - nsXPIDLCString fileEx; - fileURL->GetFileExtension(getter_Copies(fileEx)); - nsDependentCString fileExtension(fileEx.get()); + nsCAutoString fileExtension; + fileURL->GetFileExtension(fileExtension); PRBool setExtension = PR_FALSE; if (mContentType.Equals("text/html")) { @@ -1124,8 +1115,8 @@ nsHeaderSniffer::OnSecurityChange(nsIWeb return nsnull; } - nsXPIDLCString spec; - uri->GetSpec(getter_Copies(spec)); + nsCAutoString spec; + uri->GetSpec(spec); const char* cstr = spec.get(); NSString* str = [NSString stringWithCString:cstr];