mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
fixing code that relied on implicit string construction
This commit is contained in:
parent
44952a090c
commit
798d32a8dc
@ -922,7 +922,7 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const char *folderPath,
|
||||
explicitlyVerify = !(boxFlags & kNameSpace);
|
||||
}
|
||||
|
||||
nsCAutoString folderName = dupFolderPath;
|
||||
nsCAutoString folderName(dupFolderPat);
|
||||
|
||||
nsCAutoString uri;
|
||||
nsXPIDLCString serverUri;
|
||||
|
@ -724,13 +724,13 @@ void nsEudoraAddress::BuildSingleCard( CAliasEntry *pEntry, CAliasData *pData, n
|
||||
|
||||
*/
|
||||
|
||||
nsCString displayName = pData->m_realName;
|
||||
nsCString displayName(pData->m_realName);
|
||||
nsCString name;
|
||||
nsCString fax;
|
||||
nsCString phone;
|
||||
nsCString address;
|
||||
nsCString address2;
|
||||
nsCString note = pEntry->m_notes;
|
||||
nsCString note(pEntry->m_notes);
|
||||
if (note.Length() > 0) {
|
||||
ExtractNoteField( note, fax, "fax");
|
||||
ExtractNoteField( note, phone, "phone");
|
||||
|
@ -99,7 +99,7 @@ PRBool nsEudoraWin32::FindEudoraLocation( nsIFileSpec *pFolder, PRBool findIni)
|
||||
// get the value of "Current"
|
||||
BYTE *pBytes = GetValueBytes( sKey, "Current");
|
||||
if (pBytes) {
|
||||
nsCString str = (const char *)pBytes;
|
||||
nsCString str((const char *)pBytes);
|
||||
delete [] pBytes;
|
||||
|
||||
// Command line is Eudora mailfolder eudora.ini
|
||||
@ -513,7 +513,7 @@ nsresult nsEudoraWin32::FindTOCFile( nsIFileSpec *pMailFile, nsIFileSpec **ppTOC
|
||||
if (NS_FAILED( rv))
|
||||
return( rv);
|
||||
|
||||
nsCString leaf = pName;
|
||||
nsCString leaf(pName);
|
||||
nsCRT::free( pName);
|
||||
nsCString name;
|
||||
if ((leaf.Length() > 4) && (leaf.CharAt( leaf.Length() - 4) == '.'))
|
||||
@ -559,7 +559,7 @@ PRBool nsEudoraWin32::ImportSettings( nsIFileSpec *pIniFile, nsIMsgAccount **loc
|
||||
if (!pIniPath)
|
||||
return( PR_FALSE);
|
||||
|
||||
nsCString iniPath = pIniPath;
|
||||
nsCString iniPath(pIniPath);
|
||||
nsCRT::free( pIniPath);
|
||||
|
||||
UINT valInt;
|
||||
@ -567,7 +567,7 @@ PRBool nsEudoraWin32::ImportSettings( nsIFileSpec *pIniFile, nsIMsgAccount **loc
|
||||
DWORD sSize;
|
||||
DWORD sOffset = 0;
|
||||
DWORD start;
|
||||
nsCString sectionName = "Settings";
|
||||
nsCString sectionName("Settings");
|
||||
int popCount = 0;
|
||||
int accounts = 0;
|
||||
|
||||
@ -684,7 +684,7 @@ void nsEudoraWin32::GetAccountName( const char *pSection, nsString& str)
|
||||
{
|
||||
str.Truncate();
|
||||
|
||||
nsCString s = pSection;
|
||||
nsCString s(pSection);
|
||||
|
||||
if (!s.CompareWithConversion( "Settings", PR_TRUE)) {
|
||||
str.AssignWithConversion("Eudora ");
|
||||
@ -902,7 +902,7 @@ nsresult nsEudoraWin32::GetAttachmentInfo( const char *pFileName, nsIFileSpec *p
|
||||
pSpec->GetLeafName( &pLeaf);
|
||||
if (!pLeaf)
|
||||
return( NS_ERROR_FAILURE);
|
||||
nsCString name = pLeaf;
|
||||
nsCString name(pLeaf);
|
||||
nsCRT::free( pLeaf);
|
||||
if (name.Length() > 4) {
|
||||
nsCString ext;
|
||||
@ -1042,7 +1042,7 @@ void nsEudoraWin32::GetMimeTypeFromExtension( nsCString& ext, nsCString& mimeTyp
|
||||
pSpec->GetNativePath( &pName);
|
||||
if (!pName)
|
||||
return;
|
||||
nsCString fileName = pName;
|
||||
nsCString fileName(pName);
|
||||
nsCRT::free( pName);
|
||||
|
||||
// Read the mime map section
|
||||
@ -1225,7 +1225,7 @@ nsresult nsEudoraWin32::FindAddressBooks( nsIFileSpec *pRoot, nsISupportsArray *
|
||||
spec->GetNativePath( &pName);
|
||||
if (!pName)
|
||||
return( NS_OK);
|
||||
nsCString fileName = pName;
|
||||
nsCString fileName(pName);
|
||||
nsCRT::free( pName);
|
||||
|
||||
// This is the supposed ini file name!
|
||||
@ -1238,7 +1238,7 @@ nsresult nsEudoraWin32::FindAddressBooks( nsIFileSpec *pRoot, nsISupportsArray *
|
||||
delete [] pBuffer;
|
||||
return( NS_OK);
|
||||
}
|
||||
nsCString dirs = pBuffer;
|
||||
nsCString dirs(pBuffer);
|
||||
delete [] pBuffer;
|
||||
dirs.Trim( kWhitespace);
|
||||
PRInt32 idx = 0;
|
||||
|
@ -456,7 +456,7 @@ PRBool OESettings::IdentityMatches( nsIMsgIdentity *pIdent, const char *pName, c
|
||||
rv = pIdent->GetEmail( &pIEmail);
|
||||
rv = pIdent->GetReplyTo( &pIReply);
|
||||
if (ppIName) {
|
||||
nsString name = ppIName;
|
||||
nsString name(ppIName);
|
||||
nsCRT::free( ppIName);
|
||||
pIName = name.ToNewCString();
|
||||
}
|
||||
|
@ -1279,7 +1279,7 @@ void CMapiApi::ReportLongProp( const char *pTag, LPSPropValue pVal)
|
||||
void CMapiApi::ReportStringProp( const char *pTag, LPSPropValue pVal)
|
||||
{
|
||||
if ( pVal && (PROP_TYPE( pVal->ulPropTag) == PT_TSTRING)) {
|
||||
nsCString val = (LPCTSTR) (pVal->Value.LPSZ);
|
||||
nsCString val((LPCTSTR) (pVal->Value.LPSZ));
|
||||
MAPI_TRACE2( "%s %s\n", pTag, (const char *)val);
|
||||
}
|
||||
else if (pVal && (PROP_TYPE( pVal->ulPropTag) == PT_NULL)) {
|
||||
|
@ -186,7 +186,7 @@ nsresult nsOutlookMail::GetMailFolders( nsISupportsArray **pArray)
|
||||
|
||||
PRBool nsOutlookMail::IsAddressBookNameUnique( nsCString& name, nsCString& list)
|
||||
{
|
||||
nsCString usedName = "[";
|
||||
nsCString usedName("[");
|
||||
usedName.Append( name);
|
||||
usedName.Append( "],");
|
||||
|
||||
@ -803,7 +803,7 @@ void nsOutlookMail::BuildAttachments( CMapiMessage& msg, int count)
|
||||
a->description = nsCRT::strdup( msg.GetFileName());
|
||||
if (!nsCRT::strlen( a->description)) {
|
||||
nsCRT::free( a->description);
|
||||
nsCString str = "Attachment ";
|
||||
nsCString str("Attachment ");
|
||||
str.AppendInt( (PRInt32) i);
|
||||
a->description = nsCRT::strdup( (const char *)str);
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ PRBool OutlookSettings::IdentityMatches( nsIMsgIdentity *pIdent, const char *pNa
|
||||
rv = pIdent->GetReplyTo( &pIReply);
|
||||
|
||||
if (ppIName) {
|
||||
nsString name = ppIName;
|
||||
nsString name(ppIName);
|
||||
nsCRT::free( ppIName);
|
||||
pIName = name.ToNewCString();
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::AddSubfolder(nsAutoString *name,
|
||||
// XXX URI should use UTF-8?
|
||||
// (see RFC2396 Uniform Resource Identifiers (URI): Generic Syntax)
|
||||
|
||||
const nsString fileCharset = nsMsgI18NFileSystemCharset();
|
||||
const nsString fileCharset(nsMsgI18NFileSystemCharset());
|
||||
char *convertedName;
|
||||
rv = ConvertFromUnicode(fileCharset, *name, &convertedName);
|
||||
if (NS_FAILED(rv))
|
||||
@ -1382,7 +1382,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName)
|
||||
// convert from PRUnichar* to char* due to not having Rename(PRUnichar*)
|
||||
// function in nsIFileSpec
|
||||
|
||||
const nsString fileCharset = nsMsgI18NFileSystemCharset();
|
||||
const nsString fileCharset(nsMsgI18NFileSystemCharset());
|
||||
char *convertedNewName;
|
||||
if (NS_FAILED(ConvertFromUnicode(fileCharset, nsAutoString(aNewName), &convertedNewName)))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -1419,7 +1419,7 @@ nsMsgNewsFolder::GetGroupPasswordWithUI(const PRUnichar * aPromptMessage, const
|
||||
rv = CreateNewsgroupPasswordUrlForSignon(mURI, getter_Copies(signonURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsAutoString realm = NS_ConvertToString(signonURL);
|
||||
nsAutoString realm(NS_ConvertToString(signonURL));
|
||||
rv = dialog->PromptPassword(aPromptTitle, aPromptMessage, realm.GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
|
||||
getter_Copies(uniGroupPassword), &okayValue);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
@ -1484,7 +1484,7 @@ nsMsgNewsFolder::GetGroupUsernameWithUI(const PRUnichar * aPromptMessage, const
|
||||
rv = CreateNewsgroupUsernameUrlForSignon(mURI, getter_Copies(signonURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsAutoString realm = NS_ConvertToString(signonURL);
|
||||
nsAutoString realm(NS_ConvertToString(signonURL));
|
||||
rv = dialog->Prompt(aPromptTitle, aPromptMessage, realm.GetUnicode(),
|
||||
nsIPrompt::SAVE_PASSWORD_PERMANENTLY, nsnull,
|
||||
getter_Copies(uniGroupUsername), &okayValue);
|
||||
|
Loading…
Reference in New Issue
Block a user