зеркало из https://github.com/mozilla/pjs.git
nsIFile->nsIURI in nsIDiskDocument r=adamlock (bug #104883)
This commit is contained in:
Родитель
3db1cf977b
Коммит
e4f2f14083
|
@ -633,13 +633,20 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal(
|
|||
// Set the document base to ensure relative links still work
|
||||
SetDocumentBase(aDocument, mCurrentBaseURI);
|
||||
|
||||
// create a uri for aFile
|
||||
char *urlString = nsnull;
|
||||
nsresult rv = aFile->GetURL(&urlString);
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), urlString);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Save the document
|
||||
nsCOMPtr<nsIDiskDocument> diskDoc = do_QueryInterface(docAsNode);
|
||||
nsString contentType; contentType.AssignWithConversion("text/html"); // TODO
|
||||
nsString charType; // Empty
|
||||
|
||||
rv = diskDoc->SaveFile(
|
||||
aFile,
|
||||
uri,
|
||||
PR_TRUE /* replace existing file */,
|
||||
PR_TRUE, /* save as a copy */
|
||||
contentType.get(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче