This fixes many crashes caused by illegal uses of the nsStdURL.
This also allows a plugable protocol to provide their own url parser.


git-svn-id: svn://10.0.0.236/trunk@97696 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
2001-06-21 22:02:47 +00:00
parent d5440c239f
commit 5c5c39e4be
62 changed files with 1129 additions and 479 deletions

View File

@@ -611,18 +611,15 @@ NS_IMETHODIMP nsHTMLEditor::InsertFromTransferable(nsITransferable *transferable
nsCOMPtr<nsIFile> fileObj ( do_QueryInterface(genericDataObj) );
if (fileObj && len > 0)
{
nsCOMPtr<nsIFileURL> fileURL;
rv = nsComponentManager::CreateInstance("@mozilla.org/network/standard-url;1", nsnull,
NS_GET_IID(nsIURL), getter_AddRefs(fileURL));
nsCOMPtr<nsIURI> uri;
rv = NS_NewFileURI(getter_AddRefs(uri), fileObj);
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIURL> fileURL(do_QueryInterface(uri));
if ( fileURL )
{
rv = fileURL->SetFile( fileObj );
if (NS_FAILED(rv))
return rv;
PRBool insertAsImage = PR_FALSE;
char *fileextension = nsnull;
rv = fileURL->GetFileExtension( &fileextension );