mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 20:42:49 +00:00
making string conversions explicit
This commit is contained in:
parent
1a7002f08c
commit
3f0250495b
@ -705,7 +705,7 @@ void nsEudoraAddress::ConvertToUnicode( const char *pStr, nsString& uniStr)
|
||||
m_pService->SystemStringToUnicode( pStr, uniStr);
|
||||
}
|
||||
else
|
||||
uniStr.Assign( pStr);
|
||||
uniStr.AssignWithConversion( pStr);
|
||||
}
|
||||
|
||||
void nsEudoraAddress::BuildSingleCard( CAliasEntry *pEntry, CAliasData *pData, nsIAddrDatabase *pDb)
|
||||
|
@ -195,7 +195,7 @@ nsresult nsEudoraCompose::CreateIdentity( void)
|
||||
NS_WITH_PROXIED_SERVICE(nsIMsgAccountManager, accMgr, kMsgAccountMgrCID, NS_UI_THREAD_EVENTQ, &rv);
|
||||
if (NS_FAILED(rv)) return( rv);
|
||||
rv = accMgr->CreateIdentity( &m_pIdentity);
|
||||
nsString name = "Import Identity";
|
||||
nsString name; name.AssignWithConversion("Import Identity");
|
||||
if (m_pIdentity) {
|
||||
m_pIdentity->SetFullName( name.GetUnicode());
|
||||
m_pIdentity->SetIdentityName( name.GetUnicode());
|
||||
@ -480,7 +480,7 @@ void nsEudoraCompose::ExtractType( nsString& str)
|
||||
// valid multipart!
|
||||
if (str.Length() > 10) {
|
||||
str.Left( tStr, 10);
|
||||
if (!tStr.Compare( "multipart/", PR_TRUE))
|
||||
if (!tStr.CompareWithConversion( "multipart/", PR_TRUE))
|
||||
str.Truncate();
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ private:
|
||||
val.Truncate();
|
||||
nsCString hVal;
|
||||
GetHeaderValue( pData, dataLen, pHeader, hVal, PR_TRUE);
|
||||
val = hVal;
|
||||
val.AssignWithConversion(hVal);
|
||||
}
|
||||
void ExtractCharset( nsString& str);
|
||||
void ExtractType( nsString& str);
|
||||
|
@ -395,7 +395,7 @@ NS_IMETHODIMP ImportMailImpl::FindMailboxes( nsIFileSpec *pLoc, nsISupportsArray
|
||||
void ImportMailImpl::AddLinebreak( nsString *pStream)
|
||||
{
|
||||
if (pStream)
|
||||
pStream->Append( NS_LINEBREAK);
|
||||
pStream->AppendWithConversion( NS_LINEBREAK);
|
||||
}
|
||||
|
||||
void ImportMailImpl::ReportSuccess( nsString& name, PRInt32 count, nsString *pStream)
|
||||
|
@ -304,7 +304,7 @@ nsresult nsEudoraMac::IterateMailDir( nsIFileSpec *pFolder, nsISupportsArray *pA
|
||||
|
||||
nsresult nsEudoraMac::FoundMailbox( nsIFileSpec *mailFile, const char *pName, nsISupportsArray *pArray, nsIImportService *pImport)
|
||||
{
|
||||
nsString displayName = pName;
|
||||
nsString displayName; displayName.AssignWithConversion(pName);
|
||||
nsCOMPtr<nsIImportMailboxDescriptor> desc;
|
||||
nsISupports * pInterface;
|
||||
|
||||
@ -345,7 +345,7 @@ nsresult nsEudoraMac::FoundMailbox( nsIFileSpec *mailFile, const char *pName, ns
|
||||
|
||||
nsresult nsEudoraMac::FoundMailFolder( nsIFileSpec *mailFolder, const char *pName, nsISupportsArray *pArray, nsIImportService *pImport)
|
||||
{
|
||||
nsString displayName = pName;
|
||||
nsString displayName; displayName.AssignWithConversion(pName);
|
||||
nsCOMPtr<nsIImportMailboxDescriptor> desc;
|
||||
nsISupports * pInterface;
|
||||
|
||||
@ -601,7 +601,7 @@ PRBool nsEudoraMac::ImportSettings( nsIFileSpec *pIniFile, nsIMsgAccount **local
|
||||
pStrs[i] = new nsCString;
|
||||
}
|
||||
|
||||
nsString accName = "Eudora Settings";
|
||||
nsString accName; accName.AssignWithConversion("Eudora Settings");
|
||||
nsEudoraStringBundle::GetStringByID( EUDORAIMPORT_ACCOUNTNAME, accName);
|
||||
|
||||
// This is a little overkill but we're not sure yet how multiple accounts
|
||||
@ -1140,7 +1140,7 @@ nsresult nsEudoraMac::FindAddressBooks( nsIFileSpec *pRoot, nsISupportsArray **p
|
||||
rv = spec->IsFile( &isFile);
|
||||
rv = spec->GetLeafName( &pName);
|
||||
if (pName) {
|
||||
displayName = pName;
|
||||
displayName.AssignWithConversion(pName);
|
||||
nsCRT::free( pName);
|
||||
}
|
||||
if (NS_SUCCEEDED( rv) && pName && isFile) {
|
||||
|
@ -92,9 +92,9 @@ PRUnichar *nsEudoraStringBundle::GetStringByID(PRInt32 stringID, nsIStringBundle
|
||||
return( ptrv);
|
||||
}
|
||||
|
||||
nsString resultString( "[StringID ");
|
||||
resultString.Append(stringID, 10);
|
||||
resultString += "?]";
|
||||
nsString resultString; resultString.AssignWithConversion( "[StringID ");
|
||||
resultString.AppendInt(stringID, 10);
|
||||
resultString.AppendWithConversion("?]");
|
||||
|
||||
return( resultString.ToNewUnicode());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user