зеркало из https://github.com/mozilla/pjs.git
fixing code that relied on implicit string construction
This commit is contained in:
Родитель
6dc0b1da8f
Коммит
f065fa4f1f
|
@ -430,7 +430,7 @@ NS_IMETHODIMP nsBrowserWindow::SetTitle(const PRUnichar* aTitle)
|
|||
|
||||
mTitle = aTitle;
|
||||
|
||||
NS_ENSURE_SUCCESS(mWindow->SetTitle(aTitle), NS_ERROR_FAILURE);
|
||||
NS_ENSURE_SUCCESS(mWindow->SetTitle(nsAutoString(aTitle)), NS_ERROR_FAILURE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2187,7 +2187,7 @@ nsBrowserWindow::OnStatus(nsIChannel* channel, nsISupports *ctxt,
|
|||
rv = sbs->FormatStatusMessage(aStatus, aStatusArg, getter_Copies(msg));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
PRUint32 size;
|
||||
nsAutoString msg2 = (const PRUnichar*)msg;
|
||||
nsAutoString msg2( NS_STATIC_CAST(const PRUnichar*, msg));
|
||||
mStatus->SetText(msg2, size);
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -86,7 +86,7 @@ NS_IMETHODIMP nsWebBrowserChrome::SetJSStatus(const PRUnichar* aStatus)
|
|||
NS_ENSURE_STATE(mBrowserWindow->mStatus);
|
||||
|
||||
PRUint32 size;
|
||||
mBrowserWindow->mStatus->SetText(aStatus, size);
|
||||
mBrowserWindow->mStatus->SetText(nsAutoString(aStatus), size);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ NS_IMETHODIMP nsWebBrowserChrome::SetOverLink(const PRUnichar* aLink)
|
|||
return NS_OK;
|
||||
|
||||
PRUint32 size;
|
||||
mBrowserWindow->mStatus->SetText(aLink, size);
|
||||
mBrowserWindow->mStatus->SetText(nsAutoString(aLink), size);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ nsWebBrowserChrome::OnStatusChange(nsIWebProgress* aWebProgress,
|
|||
{
|
||||
if (mBrowserWindow->mStatus) {
|
||||
PRUint32 size;
|
||||
mBrowserWindow->mStatus->SetText(aMessage, size);
|
||||
mBrowserWindow->mStatus->SetText(nsAutoString(aMessage), size);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -361,7 +361,7 @@ NS_IMETHODIMP nsXPBaseWindow::SetTitle(const PRUnichar* aTitle)
|
|||
NS_PRECONDITION(nsnull != mWindow, "null window");
|
||||
mTitle = aTitle;
|
||||
nsAutoString newTitle(aTitle);
|
||||
mWindow->SetTitle(newTitle.GetUnicode());
|
||||
mWindow->SetTitle(newTitle);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -421,7 +421,7 @@ nsFindComponent::Context::DoFind(PRBool *aDidFind)
|
|||
|
||||
*aDidFind = PR_FALSE;
|
||||
|
||||
nsAutoString matchString = mSearchString;
|
||||
nsAutoString matchString(mSearchString);
|
||||
if (!mCaseSensitive)
|
||||
matchString.ToLowerCase();
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ nsStreamTransfer::SelectFileAndTransferLocation( nsIChannel *aChannel, nsIDOMWin
|
|||
nsresult rv = httpChannel->GetResponseHeader( atom, getter_Copies( disp ) );
|
||||
if ( NS_SUCCEEDED( rv ) && disp ) {
|
||||
// Parse out file name.
|
||||
nsCAutoString contentDisp = (const char*)disp;
|
||||
nsCAutoString contentDisp(NS_STATIC_CAST(const char*, disp));
|
||||
// Remove whitespace.
|
||||
contentDisp.StripWhitespace();
|
||||
// Look for ";filename=".
|
||||
|
@ -122,7 +122,7 @@ nsStreamTransfer::SelectFileAndTransferLocation( nsIChannel *aChannel,
|
|||
PRBool isValid = PR_FALSE;
|
||||
nsresult rv = SelectFile( parent,
|
||||
getter_AddRefs( outputFile ),
|
||||
SuggestNameFor( aChannel, suggestedName ).GetBuffer() );
|
||||
SuggestNameFor( aChannel, suggestedName ) );
|
||||
|
||||
if ( NS_SUCCEEDED( rv )
|
||||
&&
|
||||
|
@ -304,7 +304,7 @@ nsStreamTransfer::SelectFile( nsIDOMWindow *parent, nsIFileSpec **aResult, const
|
|||
// Guess a save-as file name from channel (URL) and/or "suggested name" (which likely
|
||||
// came from content-disposition response header).
|
||||
nsCString nsStreamTransfer::SuggestNameFor( nsIChannel *aChannel, char const *suggestedName ) {
|
||||
nsCString result = suggestedName;
|
||||
nsCString result(suggestedName);
|
||||
if ( !result.IsEmpty() ) {
|
||||
// Exclude any path information from this! This is mandatory as
|
||||
// this suggested name comes from a http response header and could
|
||||
|
|
|
@ -409,7 +409,7 @@ nsStreamXferOp::OnStatus( nsIChannel *channel,
|
|||
nsXPIDLString str;
|
||||
rv = sbs->FormatStatusMessage(aStatus, aStatusArg, getter_Copies(str));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsAutoString msg = (const PRUnichar*)str;
|
||||
nsAutoString msg(NS_STATIC_CAST(const PRUnichar*, str));
|
||||
rv = mObserver->Observe( (nsIStreamTransferOperation*)this,
|
||||
NS_ConvertASCIItoUCS2( NS_ISTREAMTRANSFER_PROGID ";onStatus" ).GetUnicode(),
|
||||
msg.GetUnicode() );
|
||||
|
@ -451,7 +451,7 @@ nsStreamXferOp::OnStopRequest( nsIChannel *channel,
|
|||
|
||||
// Notify observer that the download is complete.
|
||||
if ( mObserver ) {
|
||||
nsString msg = aMsg;
|
||||
nsString msg(aMsg);
|
||||
rv = mObserver->Observe( (nsIStreamTransferOperation*)this,
|
||||
NS_ConvertASCIItoUCS2( NS_ISTREAMTRANSFER_PROGID ";onCompletion" ).GetUnicode(),
|
||||
msg.GetUnicode() );
|
||||
|
|
Загрузка…
Ссылка в новой задаче