fixing code that relied on implicit string construction

This commit is contained in:
scc%mozilla.org 2000-08-19 22:35:49 +00:00
parent eb0aaea827
commit d447c4b511
4 changed files with 9 additions and 9 deletions

View File

@ -2828,7 +2828,7 @@ NS_IMETHODIMP nsDocShell::CreateFixupURI(const PRUnichar* aStringURI,
uriString.Trim(" "); // Cleanup the empty spaces that might be on each end.
// Just try to create an URL out of it
NS_NewURI(aURI, uriString.GetUnicode(), nsnull);
NS_NewURI(aURI, uriString, nsnull);
if(*aURI)
return NS_OK;
@ -2861,7 +2861,7 @@ NS_IMETHODIMP nsDocShell::CreateFixupURI(const PRUnichar* aStringURI,
else
uriString.InsertWithConversion("http://", 0, 7);
} // end if checkprotocol
return NS_NewURI(aURI, uriString.GetUnicode(), nsnull);
return NS_NewURI(aURI, uriString, nsnull);
}
NS_IMETHODIMP nsDocShell::FileURIFixup(const PRUnichar* aStringURI,
@ -3460,7 +3460,7 @@ nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, nsDocShellInfoLoadType
if (!uriAttrib) {
uri = baseURI;
} else {
NS_NewURI(getter_AddRefs(uri), uriAttrib, baseURI);
NS_NewURI(getter_AddRefs(uri), nsAutoString(uriAttrib), baseURI);
nsMemory::Free(uriAttrib);
}

View File

@ -515,14 +515,14 @@ nsWebShell::GetReferrer(nsIURI **aReferrer)
void
nsWebShell::SetReferrer(const PRUnichar* aReferrer)
{
NS_NewURI(getter_AddRefs(mReferrerURI), aReferrer, nsnull);
NS_NewURI(getter_AddRefs(mReferrerURI), nsAutoString(aReferrer), nsnull);
}
NS_IMETHODIMP
nsWebShell::SetURL(const PRUnichar* aURL)
{
nsCOMPtr<nsIURI> uri;
NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(uri), aURL, nsnull),
NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(uri), nsAutoString(aURL), nsnull),
NS_ERROR_FAILURE);
SetCurrentURI(uri);
return NS_OK;
@ -828,7 +828,7 @@ nsWebShell::HandleLinkClickEvent(nsIContent *aContent,
// and down in the load document code we'll detect this and
// set the correct uri loader command
nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), aURLSpec, nsnull);
NS_NewURI(getter_AddRefs(uri), nsAutoString(aURLSpec), nsnull);
nsCOMPtr<nsISupports> owner;
GetCurrentDocumentOwner(getter_AddRefs(owner));

View File

@ -481,7 +481,7 @@ NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
//XXX "aboutStrName" should be less hardcoded
PRUnichar *ptrv = nsnull;
bundle->GetStringFromName(NS_ConvertASCIItoUCS2("aboutStrName").GetUnicode(), &ptrv);
nsAutoString label = ptrv;
nsAutoString label(ptrv);
nsCRT::free(ptrv);
::AppendMenu(appleMenu, "\pa");

View File

@ -89,7 +89,7 @@ nsMimeMapperMac :: MapMimeTypeToMacOSType ( const char* aMimeStr, PRBool inAddIf
format |= ('..MZ' << 16);
// stick it in the mapping list
mMappings.push_back ( MimePair(format, aMimeStr) );
mMappings.push_back ( MimePair(format, nsCAutoString(aMimeStr)) );
}
}
@ -164,7 +164,7 @@ nsMimeMapperMac :: ParseMappings ( const char* inMappings )
ResType flavor = nsnull;
sscanf ( currPosition, "%ld %s ", &flavor, mimeType );
mMappings.push_back( MimePair(flavor, mimeType) );
mMappings.push_back( MimePair(flavor, nsCAutoString(mimeType)) );
currPosition += 10 + 2 + strlen(mimeType); // see ExportMapping() for explanation of this calculation