From 26ac38b3c8e7defb8a61e0a958ed7f9fe3a7e527 Mon Sep 17 00:00:00 2001 From: "scc%mozilla.org" Date: Sun, 20 Aug 2000 06:17:15 +0000 Subject: [PATCH] fixing code that relied on implicit string construction --- mailnews/absync/src/nsAbSync.cpp | 4 ++-- mailnews/addrbook/src/nsAbAutoCompleteSession.cpp | 4 ++-- mailnews/addrbook/src/nsAbRDFDataSource.cpp | 2 +- mailnews/addrbook/src/nsAddbookProtocolHandler.cpp | 2 +- mailnews/addrbook/src/nsAddbookUrl.cpp | 4 ++-- mailnews/addrbook/src/nsCardDataSource.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mailnews/absync/src/nsAbSync.cpp b/mailnews/absync/src/nsAbSync.cpp index 60ff8034a89..fe9ce28fa7d 100644 --- a/mailnews/absync/src/nsAbSync.cpp +++ b/mailnews/absync/src/nsAbSync.cpp @@ -626,7 +626,7 @@ NS_IMETHODIMP nsAbSync::PerformAbSync(nsIDOMWindow *aDOMWindow, PRInt32 *aTransa // if ( (mAbSyncAddressBook) && (*mAbSyncAddressBook) ) { - nsCString prefId = "ldap_2.servers."; + nsCString prefId("ldap_2.servers."); prefId.Append(mAbSyncAddressBook); prefId.Append(".filename"); @@ -2822,7 +2822,7 @@ nsAbSync::AddValueToNewCard(nsIAbCard *aCard, nsString *aTagName, nsString *aTag tValue = aTagValue->ToNewCString(); if (tValue) { - rv = nsMsgI18NConvertToUnicode(nsCString("UTF-8"), tValue, outValue); + rv = nsMsgI18NConvertToUnicode(nsCString("UTF-8"), nsCString(tValue), outValue); if (NS_SUCCEEDED(rv)) aTagValue->Assign(outValue); PR_FREEIF(tValue); diff --git a/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp b/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp index 7248523c804..074a9172b00 100644 --- a/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp +++ b/mailnews/addrbook/src/nsAbAutoCompleteSession.cpp @@ -115,7 +115,7 @@ void nsAbAutoCompleteSession::AddToResult(const PRUnichar* pNickNameStr, const P if (mDefaultDomain[0] == 0) return; - nsAutoString aStr = pNameStr; + nsAutoString aStr(pNameStr); aStr.AppendWithConversion('@'); aStr += mDefaultDomain; fullAddrStr = aStr.ToNewUnicode(); @@ -151,7 +151,7 @@ void nsAbAutoCompleteSession::AddToResult(const PRUnichar* pNickNameStr, const P if (!fullAddrStr) { //oops, parser problem! I will try to do my best... - nsAutoString aStr = pNameStr; + nsAutoString aStr(pNameStr); aStr.AppendWithConversion(" <"); if (bIsMailList) { diff --git a/mailnews/addrbook/src/nsAbRDFDataSource.cpp b/mailnews/addrbook/src/nsAbRDFDataSource.cpp index 207eb54a104..8aaef23c1de 100644 --- a/mailnews/addrbook/src/nsAbRDFDataSource.cpp +++ b/mailnews/addrbook/src/nsAbRDFDataSource.cpp @@ -146,7 +146,7 @@ nsresult nsAbRDFDataSource::NotifyPropertyChanged(nsIRDFResource *resource, const PRUnichar *newValue) { nsCOMPtr newValueNode; - nsString newValueStr = newValue; + nsString newValueStr(newValue); createNode(newValueStr, getter_AddRefs(newValueNode)); NotifyObservers(resource, propertyResource, newValueNode, PR_FALSE, PR_TRUE); return NS_OK; diff --git a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp index 5c36c4d049a..3fac970a89e 100644 --- a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp +++ b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp @@ -392,7 +392,7 @@ nsAddbookProtocolHandler::GeneratePrintOutput(nsIAddbookUrl *addbookUrl, if (NS_FAILED(rv) || !pPref) goto EarlyExit; - nsCString prefId = "ldap_2.servers."; + nsCString prefId("ldap_2.servers."); prefId.Append(charAb); prefId.Append(".filename"); diff --git a/mailnews/addrbook/src/nsAddbookUrl.cpp b/mailnews/addrbook/src/nsAddbookUrl.cpp index 53c84fdfc5c..c1da7158d8f 100644 --- a/mailnews/addrbook/src/nsAddbookUrl.cpp +++ b/mailnews/addrbook/src/nsAddbookUrl.cpp @@ -117,8 +117,8 @@ nsAddbookUrl::CrackAddURL(char *searchPart) NS_IMETHODIMP nsAddbookUrl::CrackPrintURL(char *searchPart, PRInt32 aOperation) { - nsCString emailAddr = ""; - nsCString folderName = ""; + nsCString emailAddr; + nsCString folderName; char *rest = searchPart; diff --git a/mailnews/addrbook/src/nsCardDataSource.cpp b/mailnews/addrbook/src/nsCardDataSource.cpp index 66e11fbe120..0a8c87b2ae3 100644 --- a/mailnews/addrbook/src/nsCardDataSource.cpp +++ b/mailnews/addrbook/src/nsCardDataSource.cpp @@ -679,7 +679,7 @@ nsresult nsAbCardDataSource::DoNewCard(nsIAbCard *card, nsISupportsArray *argume { PRUnichar *name; literal->GetValue(&name); - nsString tempStr = name; + nsString tempStr(name); nsMemory::Free(name); nsCAutoString nameStr; nameStr.AssignWithConversion(tempStr);