fixing code that relied on implicit string construction

This commit is contained in:
scc%mozilla.org 2000-08-19 22:35:49 +00:00
Родитель 301746a559
Коммит 4f2c82d5e5
4 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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));

Просмотреть файл

@ -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");

Просмотреть файл

@ -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