diff --git a/mozilla/mailnews/imap/src/nsIMAPBodyShell.cpp b/mozilla/mailnews/imap/src/nsIMAPBodyShell.cpp index 74dc08b4e6a..5c06e8c65de 100644 --- a/mozilla/mailnews/imap/src/nsIMAPBodyShell.cpp +++ b/mozilla/mailnews/imap/src/nsIMAPBodyShell.cpp @@ -89,7 +89,7 @@ nsIMAPBodyShell::nsIMAPBodyShell(nsImapProtocol *protocolConnection, const char if (!buf) return; m_UID = ""; - m_UID.Append(UID, 10); + m_UID.AppendInt(UID, 10); #ifdef DEBUG_chrisf NS_ASSERTION(folderName); #endif @@ -1686,7 +1686,7 @@ nsIMAPBodyShell *nsIMAPBodyShellCache::FindShellForUID(PRUint32 UID, const char { nsCString uidString; - uidString.Append(UID, 10); + uidString.AppendInt(UID, 10); nsIMAPBodyShell *rv = FindShellForUID(uidString, mailboxName); return rv; } diff --git a/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp b/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp index 09bd5996773..ce1622633ed 100644 --- a/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp +++ b/mozilla/mailnews/imap/src/nsIMAPHostSessionList.cpp @@ -184,7 +184,7 @@ NS_IMETHODIMP nsIMAPHostSessionList::GetPasswordForHost(const char *serverKey, n PR_EnterMonitor(gCachedHostInfoMonitor); nsIMAPHostInfo *host = FindHost(serverKey); if (host) - result = host->fCachedPassword; + result.AssignWithConversion(host->fCachedPassword); PR_ExitMonitor(gCachedHostInfoMonitor); return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK; } @@ -230,7 +230,7 @@ NS_IMETHODIMP nsIMAPHostSessionList::GetOnlineDirForHost(const char *serverKey, PR_EnterMonitor(gCachedHostInfoMonitor); nsIMAPHostInfo *host = FindHost(serverKey); if (host) - result = host->fOnlineDir; + result.AssignWithConversion(host->fOnlineDir); PR_ExitMonitor(gCachedHostInfoMonitor); return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK; } @@ -321,7 +321,7 @@ NS_IMETHODIMP nsIMAPHostSessionList::GetHierarchyDelimiterStringForHost(const ch PR_EnterMonitor(gCachedHostInfoMonitor); nsIMAPHostInfo *host = FindHost(serverKey); if (host) - result = host->fHierarchyDelimiters; + result.AssignWithConversion(host->fHierarchyDelimiters); PR_ExitMonitor(gCachedHostInfoMonitor); return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK; } @@ -693,12 +693,12 @@ NS_IMETHODIMP nsIMAPHostSessionList::GetOnlineInboxPathForHost(const char *serve ns = host->fNamespaceList->GetDefaultNamespaceOfType(kPersonalNamespace); if (ns) { - result = PR_smprintf("%sINBOX",ns->GetPrefix()); + result.AssignWithConversion(PR_smprintf("%sINBOX",ns->GetPrefix())); } } else { - result = ""; + result.SetLength(0); } PR_ExitMonitor(gCachedHostInfoMonitor); return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK; diff --git a/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp b/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp index c8c3c15307a..178761bf897 100644 --- a/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mozilla/mailnews/imap/src/nsImapIncomingServer.cpp @@ -753,9 +753,9 @@ nsresult nsImapIncomingServer::GetFolder(const char* name, nsIMsgFolder** pFolde rv = rootFolder->GetURI(&uri); if (NS_SUCCEEDED(rv) && uri) { - nsAutoString uriAutoString = uri; - uriAutoString.Append('/'); - uriAutoString.Append(name); + nsAutoString uriAutoString; uriAutoString.AssignWithConversion(uri); + uriAutoString.AppendWithConversion('/'); + uriAutoString.AppendWithConversion(name); NS_WITH_SERVICE(nsIRDFService, rdf, kRDFServiceCID, &rv); if (NS_FAILED(rv)) return rv; char* uriString = uriAutoString.ToNewCString(); @@ -1282,7 +1282,7 @@ NS_IMETHODIMP nsImapIncomingServer::FEAlertFromServer(const char *aString) if (serverSaidPrefix) { nsAutoString message(serverSaidPrefix); - message += whereRealMessage ? whereRealMessage : serverSaid; + message.AppendWithConversion(whereRealMessage ? whereRealMessage : serverSaid); rv = dialog->Alert(message.GetUnicode()); PR_Free(serverSaidPrefix); @@ -1299,7 +1299,7 @@ static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); NS_IMETHODIMP nsImapIncomingServer::GetImapStringByID(PRInt32 aMsgId, PRUnichar **aString) { - nsAutoString resultString = "???"; + nsAutoString resultString; resultString.AssignWithConversion("???"); nsresult res = NS_OK; if (!m_stringBundle) @@ -1323,9 +1323,9 @@ NS_IMETHODIMP nsImapIncomingServer::GetImapStringByID(PRInt32 aMsgId, PRUnichar if (NS_FAILED(res)) { - resultString = "[StringID"; - resultString.Append(aMsgId, 10); - resultString += "?]"; + resultString.AssignWithConversion("[StringID"); + resultString.AppendInt(aMsgId, 10); + resultString.AssignWithConversion("?]"); *aString = resultString.ToNewUnicode(); } else diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index bc3aa467aa8..cbcd18c778c 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -206,7 +206,7 @@ nsresult nsImapMailFolder::AddDirectorySeparator(nsFileSpec &path) // unfortunately we can't just say: // path += sep; // here because of the way nsFileSpec concatenates - nsAutoString str((nsFilePath)path); + nsAutoString str; str.AssignWithConversion(NS_STATIC_CAST(nsFilePath, path)); str += sep; path = nsFilePath(str); } @@ -240,8 +240,8 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfolderWithPath(nsAutoString *name, nsIFile PRInt32 flags = 0; nsAutoString uri; - uri.Append(mURI); - uri.Append('/'); + uri.AppendWithConversion(mURI); + uri.AppendWithConversion('/'); uri.Append(*name); char* uriStr = uri.ToNewCString(); @@ -274,16 +274,16 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfolderWithPath(nsAutoString *name, nsIFile if(NS_SUCCEEDED(rv) && isServer) { - if(name->Compare("Inbox", PR_TRUE) == 0) + if(name->CompareWithConversion("Inbox", PR_TRUE) == 0) flags |= MSG_FOLDER_FLAG_INBOX; - else if(name->Compare("Trash", PR_TRUE) == 0) + else if(name->CompareWithConversion("Trash", PR_TRUE) == 0) flags |= MSG_FOLDER_FLAG_TRASH; #if 0 - else if(name->Compare("Sent", PR_TRUE) == 0) + else if(name->CompareWithConversion("Sent", PR_TRUE) == 0) folder->SetFlag(MSG_FOLDER_FLAG_SENTMAIL); - else if(name->Compare("Drafts", PR_TRUE) == 0) + else if(name->CompareWithConversion("Drafts", PR_TRUE) == 0) folder->SetFlag(MSG_FOLDER_FLAG_DRAFTS); - else if (name->Compare("Templates", PR_TRUE) == 0) + else if (name->CompareWithConversion("Templates", PR_TRUE) == 0) folder->SetFlag(MSG_FOLDER_FLAG_TEMPLATES); #endif } @@ -318,7 +318,7 @@ nsresult nsImapMailFolder::CreateSubFolders(nsFileSpec &path) { nsFileSpec currentFolderPath = (nsFileSpec&)dir; folderName = currentFolderPath.GetLeafName(); - currentFolderNameStr = folderName; + currentFolderNameStr.AssignWithConversion(folderName); if (nsShouldIgnoreFile(currentFolderNameStr)) { PL_strfree(folderName); @@ -364,7 +364,7 @@ nsresult nsImapMailFolder::CreateSubFolders(nsFileSpec &path) currentFolderNameStr.Cut(0, leafPos + 1); // take the utf7 full online name, and determine the utf7 leaf name - utf7LeafName.Assign(onlineFullUtf7Name); + utf7LeafName.AssignWithConversion(onlineFullUtf7Name); leafPos = utf7LeafName.RFindChar('/'); if (leafPos > 0) utf7LeafName.Cut(0, leafPos + 1); @@ -593,7 +593,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName if(NS_FAILED(rv)) return rv; - nsAutoString leafName (folderName); + nsAutoString leafName; leafName.AssignWithConversion(folderName); nsAutoString folderNameStr; nsAutoString parentName = leafName; PRInt32 folderStart = leafName.FindChar('/'); @@ -609,7 +609,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName rv = CreateDirectoryForFolder(path); if (NS_FAILED(rv)) return rv; uri.Append('/'); - uri.Append(parentName); + uri.AppendWithConversion(parentName); rv = rdf->GetResource(uri, getter_AddRefs(res)); if (NS_FAILED(rv)) return rv; @@ -662,8 +662,8 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName { nsCAutoString onlineName = m_onlineFolderName; if (onlineName.Length() > 0) - onlineName += hierarchyDelimiter; - onlineName.Append(folderNameStr); + onlineName.AppendWithConversion(hierarchyDelimiter); + onlineName.AppendWithConversion(folderNameStr); imapFolder->SetVerifiedAsOnlineFolder(PR_TRUE); imapFolder->SetOnlineName(onlineName.GetBuffer()); imapFolder->SetHierarchyDelimiter(hierarchyDelimiter); @@ -1222,7 +1222,7 @@ NS_IMETHODIMP nsImapMailFolder::SetOnlineName(const char * aOnlineFolderName) rv = GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db)); if(NS_SUCCEEDED(rv)) { - nsAutoString onlineName(aOnlineFolderName); + nsAutoString onlineName; onlineName.AssignWithConversion(aOnlineFolderName); rv = folderInfo->SetProperty("onlineName", &onlineName); // so, when are we going to commit this? Definitely not every time! // We could check if the online name has changed. @@ -1289,7 +1289,7 @@ nsImapMailFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInfo, nsIMsgDatab nsXPIDLCString name; rv = nsImapURI2FullName(kImapRootURI, hostname, uri, getter_Copies(name)); m_onlineFolderName.Assign(name); - nsAutoString autoOnlineName(name); + nsAutoString autoOnlineName; autoOnlineName.AssignWithConversion(name); rv = (*folderInfo)->SetProperty("onlineName", &autoOnlineName); PR_FREEIF(uri); PR_FREEIF(hostname); @@ -1359,9 +1359,9 @@ nsImapMailFolder::AllocateUidStringFromKeyArray(nsMsgKeyArray &keyArray, nsCStri } else if (curSequenceEnd > startSequence) { - msgIds.Append(startSequence, 10); + msgIds.AppendInt(startSequence, 10); msgIds += ':'; - msgIds.Append(curSequenceEnd, 10); + msgIds.AppendInt(curSequenceEnd, 10); if (!lastKey) msgIds += ','; startSequence = nextKey; @@ -1371,7 +1371,7 @@ nsImapMailFolder::AllocateUidStringFromKeyArray(nsMsgKeyArray &keyArray, nsCStri { startSequence = nextKey; curSequenceEnd = startSequence; - msgIds.Append(keyArray[keyIndex], 10); + msgIds.AppendInt(keyArray[keyIndex], 10); if (!lastKey) msgIds += ','; } @@ -2204,7 +2204,7 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFilterHit(nsIMsgFilter *filter, PRBool *app // so we use an nsString from above. PRUnichar *folderName = nsnull; rv = mailTrash->GetName(&folderName); - trashNameVal = nsCAutoString(folderName); + trashNameVal.AssignWithConversion(folderName); nsCRT::free(folderName); value = (void *) trashNameVal.GetBuffer(); } @@ -3862,7 +3862,7 @@ nsImapMailFolder::CopyFileMessage(nsIFileSpec* fileSpec, { rv = msgToReplace->GetMessageKey(&key); if (NS_SUCCEEDED(rv)) - messageId.Append((PRInt32) key); + messageId.AppendInt((PRInt32) key); } rv = InitCopyState(srcSupport, messages, PR_FALSE, isDraftOrTemplate, @@ -4024,7 +4024,7 @@ NS_IMETHODIMP nsImapMailFolder::MatchName(nsString *name, PRBool *matches) if (!matches) return NS_ERROR_NULL_POINTER; PRBool isInbox = mName.EqualsIgnoreCase("inbox"); - *matches = mName.Equals(*name, isInbox); + *matches = mName.EqualsWithConversion(*name, isInbox); return NS_OK; } diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 3e7b31c3661..8ead1f2905e 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -3013,7 +3013,7 @@ void nsImapProtocol::ProcessMailboxUpdate(PRBool handlePossibleUndo) } else { - fetchStr.Append(GetServerStateParser().HighestRecordedUID() + 1, 10); + fetchStr.AppendInt(GetServerStateParser().HighestRecordedUID() + 1, 10); fetchStr.Append(":*"); // sprintf(fetchStr, "%ld:*", GetServerStateParser().HighestRecordedUID() + 1); @@ -3247,7 +3247,7 @@ void nsImapProtocol::PeriodicBiff() id = 1; //sprintf(fetchStr, "%ld:%ld", id, id + GetServerStateParser().NumberOfMessages() - fFlagState->GetNumberOfMessages()); - fetchStr.Append(id, 10); + fetchStr.AppendInt(id, 10); fetchStr.Append(":*"); FetchMessage(fetchStr, kFlags, PR_TRUE); @@ -3959,7 +3959,7 @@ nsImapProtocol::AlertUserEvent(const char * message) { if (m_imapServerSink) { - nsAutoString uniString(message); + nsAutoString uniString; uniString.AssignWithConversion(message); m_imapServerSink->FEAlert(uniString.GetUnicode()); } } @@ -3991,7 +3991,7 @@ nsImapProtocol::ShowProgress() if (m_progressString && m_progressStringId) { PRUnichar *progressString = NULL; - nsCString cProgressString(m_progressString); + nsCString cProgressString; cProgressString.AssignWithConversion(m_progressString); const char *mailboxName = GetServerStateParser().GetSelectedMailboxName(); nsXPIDLString unicodeMailboxName; @@ -4074,7 +4074,7 @@ PRUnichar * nsImapProtocol::CreatePRUnicharStringFromUTF7(const char * aSourceSt if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsString aCharset("x-imap4-modified-utf7"); + nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); PRUnichar *unichars = nsnull; PRInt32 unicharLength; @@ -4465,7 +4465,7 @@ void nsImapProtocol::UploadMessageFromFile (nsIFileSpec* fileSpec, if (NS_FAILED(rv)) goto done; rv = fileSpec->OpenStreamForReading(); if (NS_FAILED(rv)) goto done; - command.Append((PRInt32)fileSize); + command.AppendInt((PRInt32)fileSize); if (hasLiteralPlus) command.Append("+}" CRLF); else @@ -5758,7 +5758,7 @@ void nsImapProtocol::NthLevelChildList(const char* onlineMailboxPrefix, int count = 0; char separator = 0; m_runningUrl->GetOnlineSubDirSeparator(&separator); - suffix = separator; + suffix.Assign(separator); suffix += '%'; while (count < depth) @@ -6246,7 +6246,7 @@ nsImapProtocol::GetDeleteIsMoveToTrash() NS_IMETHODIMP nsImapProtocol::OverrideConnectionInfo(const PRUnichar *pHost, PRUint16 pPort, const char *pCookieData) { - m_logonHost = pHost; + m_logonHost.AssignWithConversion(pHost); m_logonPort = pPort; m_logonCookie = pCookieData; m_overRideUrlConnectionInfo = PR_TRUE; diff --git a/mozilla/mailnews/imap/src/nsImapService.cpp b/mozilla/mailnews/imap/src/nsImapService.cpp index 6d614efa4d6..8999d20acc3 100644 --- a/mozilla/mailnews/imap/src/nsImapService.cpp +++ b/mozilla/mailnews/imap/src/nsImapService.cpp @@ -184,7 +184,7 @@ nsImapService::SelectFolder(nsIEventQueue * aClientEventQueue, nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); urlSpec.Append("/select>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); urlSpec.Append((const char *) folderName); rv = mailNewsUrl->SetSpec((char *) urlSpec.GetBuffer()); if (NS_SUCCEEDED(rv)) @@ -231,7 +231,7 @@ nsImapService::LiteSelectFolder(nsIEventQueue * aClientEventQueue, nsCOMPtr uri = do_QueryInterface(imapUrl); urlSpec.Append("/liteselect>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); @@ -273,7 +273,7 @@ NS_IMETHODIMP nsImapService::GetUrlForUri(const char *aMessageURI, nsIURI **aURL urlSpec.Append("fetch>"); urlSpec.Append(uidString); urlSpec.Append(">"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(folder, getter_Copies(folderName)); @@ -428,7 +428,7 @@ nsresult nsImapService::FetchMimePart(nsIImapUrl * aImapUrl, urlSpec.Append("fetch>"); urlSpec.Append(uidString); urlSpec.Append(">"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); @@ -653,7 +653,7 @@ NS_IMETHODIMP nsImapService::Search(nsIMsgSearchSession *aSearchSession, nsIMsgW nsCOMPtr mailNewsUrl = do_QueryInterface(imapUrl); urlSpec.Append("/search>UID>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); urlSpec.Append((const char *) folderName); urlSpec.Append('>'); urlSpec.Append(aSearchUri); @@ -694,7 +694,7 @@ nsresult nsImapService::DecomposeImapURI(const char * aMessageURI, nsIMsgFolder if (msgKey) { nsCAutoString messageIdString; - messageIdString.Append(msgKey, 10 /* base 10 */); + messageIdString.AppendInt(msgKey, 10 /* base 10 */); *aMsgKey = messageIdString.ToNewCString(); } } @@ -775,7 +775,7 @@ nsImapService::FetchMessage(nsIImapUrl * aImapUrl, urlSpec.Append("fetch>"); urlSpec.Append(messageIdsAreUID ? uidString : sequenceString); urlSpec.Append(">"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); @@ -908,7 +908,7 @@ nsImapService::CreateStartOfImapUrl(nsIImapUrl ** imapUrl, urlSpec.Append(hostname); urlSpec.Append(':'); - urlSpec.Append(port); + urlSpec.AppendInt(port); // *** jefft - force to parse the urlSpec in order to search for // the correct incoming server @@ -965,7 +965,7 @@ nsImapService::GetHeaders(nsIEventQueue * aClientEventQueue, urlSpec.Append("/header>"); urlSpec.Append(messageIdsAreUID ? uidString : sequenceString); urlSpec.Append(">"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; @@ -1014,7 +1014,7 @@ nsImapService::Noop(nsIEventQueue * aClientEventQueue, if (NS_SUCCEEDED(rv)) { urlSpec.Append("/selectnoop>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; @@ -1060,7 +1060,7 @@ nsImapService::Expunge(nsIEventQueue * aClientEventQueue, { urlSpec.Append("/Expunge>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; @@ -1108,13 +1108,13 @@ nsImapService::Biff(nsIEventQueue * aClientEventQueue, if (NS_SUCCEEDED(rv)) { urlSpec.Append("/Biff>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); urlSpec.Append((const char *) folderName); urlSpec.Append(">"); - urlSpec.Append(uidHighWater, 10); + urlSpec.AppendInt(uidHighWater, 10); rv = uri->SetSpec((char *) urlSpec.GetBuffer()); if (NS_SUCCEEDED(rv)) rv = GetImapConnectionAndLoadUrl(aClientEventQueue, imapUrl, @@ -1149,7 +1149,7 @@ nsImapService::DeleteFolder(nsIEventQueue* eventQueue, nsCOMPtr uri = do_QueryInterface(imapUrl); urlSpec.Append("/delete>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; rv = GetFolderName(folder, getter_Copies(folderName)); @@ -1207,7 +1207,7 @@ nsImapService::DeleteMessages(nsIEventQueue * aClientEventQueue, urlSpec.Append("/deletemsg>"); urlSpec.Append(messageIdsAreUID ? uidString : sequenceString); urlSpec.Append(">"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; @@ -1255,7 +1255,7 @@ nsImapService::DeleteAllMessages(nsIEventQueue * aClientEventQueue, nsCOMPtr uri = do_QueryInterface(imapUrl); urlSpec.Append("/deleteallmsgs>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); urlSpec.Append((const char *) folderName); @@ -1350,14 +1350,14 @@ nsresult nsImapService::DiddleFlags(nsIEventQueue * aClientEventQueue, urlSpec.Append('>'); urlSpec.Append(messageIdsAreUID ? uidString : sequenceString); urlSpec.Append(">"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); urlSpec.Append((const char *) folderName); urlSpec.Append(">"); urlSpec.Append(messageIdentifierList); urlSpec.Append('>'); - urlSpec.Append(flags, 10); + urlSpec.AppendInt(flags, 10); rv = uri->SetSpec((char *) urlSpec.GetBuffer()); if (NS_SUCCEEDED(rv)) rv = GetImapConnectionAndLoadUrl(aClientEventQueue, imapUrl, @@ -1523,7 +1523,7 @@ nsImapService::DiscoverChildren(nsIEventQueue* aClientEventQueue, nsCOMPtr uri = do_QueryInterface(aImapUrl); urlSpec.Append("/discoverchildren>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); urlSpec.Append((const char *) folderName); // mscott - this cast to a char * is okay...there's a bug in the XPIDL // compiler that is preventing in string parameters from showing up as @@ -1573,8 +1573,8 @@ nsImapService::DiscoverLevelChildren(nsIEventQueue* aClientEventQueue, { nsCOMPtr uri = do_QueryInterface(aImapUrl); urlSpec.Append("/discoverlevelchildren>"); - urlSpec.Append(level); - urlSpec.Append(hierarchySeparator); // hierarchySeparator "/" + urlSpec.AppendInt(level); + urlSpec.AppendWithConversion(hierarchySeparator); // hierarchySeparator "/" urlSpec.Append((const char *) folderName); rv = uri->SetSpec((char *) urlSpec.GetBuffer()); @@ -1648,7 +1648,7 @@ nsImapService::OnlineMessageCopy(nsIEventQueue* aClientEventQueue, else urlSpec.Append(sequenceString); urlSpec.Append('>'); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aSrcFolder, getter_Copies(folderName)); @@ -1656,7 +1656,7 @@ nsImapService::OnlineMessageCopy(nsIEventQueue* aClientEventQueue, urlSpec.Append('>'); urlSpec.Append(messageIds); urlSpec.Append('>'); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); folderName = ""; GetFolderName(aDstFolder, getter_Copies(folderName)); urlSpec.Append((const char *) folderName); @@ -1705,7 +1705,7 @@ nsImapService::AppendMessageFromFile(nsIEventQueue* aClientEventQueue, else urlSpec.Append("/appendmsgfromfile>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); nsXPIDLCString folderName; GetFolderName(aDstFolder, getter_Copies(folderName)); @@ -1853,10 +1853,10 @@ nsImapService::RenameLeaf(nsIEventQueue* eventQueue, nsIMsgFolder* srcFolder, nsXPIDLCString folderName; GetFolderName(srcFolder, getter_Copies(folderName)); urlSpec.Append("/rename>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); urlSpec.Append((const char *) folderName); urlSpec.Append('>'); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); char *utfNewName = CreateUtf7ConvertedStringFromUnicode( newLeafName); @@ -1911,11 +1911,11 @@ nsImapService::CreateFolder(nsIEventQueue* eventQueue, nsIMsgFolder* parent, nsXPIDLCString folderName; GetFolderName(parent, getter_Copies(folderName)); urlSpec.Append("/create>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); if ((const char *) folderName && nsCRT::strlen(folderName) > 0) { urlSpec.Append((const char *) folderName); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); } char *utfNewName = CreateUtf7ConvertedStringFromUnicode( newFolderName); char *escapedFolderName = nsEscape(utfNewName, url_Path); @@ -1960,7 +1960,7 @@ nsImapService::ListFolder(nsIEventQueue* aClientEventQueue, nsXPIDLCString folderName; GetFolderName(aImapMailFolder, getter_Copies(folderName)); urlSpec.Append("/listfolder>"); - urlSpec.Append(hierarchySeparator); + urlSpec.AppendWithConversion(hierarchySeparator); if ((const char *) folderName && nsCRT::strlen(folderName) > 0) { urlSpec.Append((const char *) folderName); diff --git a/mozilla/mailnews/imap/src/nsImapStringBundle.cpp b/mozilla/mailnews/imap/src/nsImapStringBundle.cpp index 87ff3108845..3d8fb2158b4 100644 --- a/mozilla/mailnews/imap/src/nsImapStringBundle.cpp +++ b/mozilla/mailnews/imap/src/nsImapStringBundle.cpp @@ -39,7 +39,7 @@ IMAPGetStringByID(PRInt32 stringID) { nsresult res; char* propertyURL = NULL; - nsString resultString = "???"; + nsString resultString; resultString.AssignWithConversion("???"); propertyURL = IMAP_MSGS_URL; @@ -60,9 +60,9 @@ IMAPGetStringByID(PRInt32 stringID) if (NS_FAILED(res)) { - resultString = "[StringID"; - resultString.Append(stringID, 10); - resultString += "?]"; + resultString.AssignWithConversion("[StringID"); + resultString.AppendInt(stringID, 10); + resultString.AppendWithConversion("?]"); return resultString.ToNewUnicode(); } diff --git a/mozilla/mailnews/imap/src/nsImapUndoTxn.cpp b/mozilla/mailnews/imap/src/nsImapUndoTxn.cpp index a8117df0934..285db927c86 100644 --- a/mozilla/mailnews/imap/src/nsImapUndoTxn.cpp +++ b/mozilla/mailnews/imap/src/nsImapUndoTxn.cpp @@ -66,26 +66,26 @@ nsImapMoveCopyMsgTxn::Init( { if (isMove) { - m_undoString = "Undo Move Messages"; - m_redoString = "Redo Move Messages"; + m_undoString.AssignWithConversion("Undo Move Messages"); + m_redoString.AssignWithConversion("Redo Move Messages"); } else { - m_undoString = "Undo Copy Messages"; - m_redoString = "Redo Copy Messages"; + m_undoString.AssignWithConversion("Undo Copy Messages"); + m_redoString.AssignWithConversion("Redo Copy Messages"); } } else { if (isMove) { - m_undoString = "Undo Move Message"; - m_redoString = "Redo Move Message"; + m_undoString.AssignWithConversion("Undo Move Message"); + m_redoString.AssignWithConversion("Redo Move Message"); } else { - m_undoString = "Undo Copy Message"; - m_redoString = "Redo Copy Message"; + m_undoString.AssignWithConversion("Undo Copy Message"); + m_redoString.AssignWithConversion("Redo Copy Message"); } } char *uri = nsnull; @@ -285,7 +285,7 @@ nsImapMoveCopyMsgTxn::AddDstKey(nsMsgKey aKey) m_dstKeyArray.Add(aKey); if (m_dstMsgIdString.Length() > 0) m_dstMsgIdString.Append(","); - m_dstMsgIdString.Append((PRInt32) aKey); + m_dstMsgIdString.AppendInt((PRInt32) aKey); return NS_OK; } diff --git a/mozilla/mailnews/imap/src/nsImapUtils.cpp b/mozilla/mailnews/imap/src/nsImapUtils.cpp index 151be1fbcd8..8e3db1b7956 100644 --- a/mozilla/mailnews/imap/src/nsImapUtils.cpp +++ b/mozilla/mailnews/imap/src/nsImapUtils.cpp @@ -143,7 +143,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult) parentName.Right(leafName, parentName.Length() - dirEnd -1); parentName.Truncate(dirEnd); NS_MsgHashIfNecessary(parentName); - parentName.Append(sbdSep); + parentName.AppendWithConversion(sbdSep); pathResult += (const char *) parentName; // this fixes a strange purify warning. parentName = (const char *) leafName; @@ -162,7 +162,7 @@ nsresult nsImapURI2FullName(const char* rootURI, const char* hostname, char* uriStr, char **name) { - nsAutoString uri = uriStr; + nsAutoString uri; uri.AssignWithConversion(uriStr); nsAutoString fullName; if (uri.Find(rootURI) != 0) return NS_ERROR_FAILURE; PRInt32 hostStart = uri.Find(hostname); @@ -381,9 +381,9 @@ void AllocateImapUidString(PRUint32 *msgUids, PRUint32 msgCount, nsCString &retu } else if (curSequenceEnd > startSequence) { - returnString.Append(startSequence, 10); + returnString.AppendInt(startSequence, 10); returnString += ':'; - returnString.Append(curSequenceEnd, 10); + returnString.AppendInt(curSequenceEnd, 10); if (!lastKey) returnString += ','; // sprintf(currentidString, "%ld:%ld,", startSequence, curSequenceEnd); @@ -394,7 +394,7 @@ void AllocateImapUidString(PRUint32 *msgUids, PRUint32 msgCount, nsCString &retu { startSequence = nextKey; curSequenceEnd = startSequence; - returnString.Append(msgUids[keyIndex], 10); + returnString.AppendInt(msgUids[keyIndex], 10); if (!lastKey) returnString += ','; // sprintf(currentidString, "%ld,", msgUids[keyIndex]); @@ -416,7 +416,7 @@ CreateUtf7ConvertedString(const char * aSourceString, if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsString aCharset("x-imap4-modified-utf7"); + nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); PRUnichar *unichars = nsnull; PRInt32 unicharLength; @@ -452,9 +452,9 @@ CreateUtf7ConvertedString(const char * aSourceString, else { // convert from 8 bit ascii string to modified utf7 - nsString unicodeStr(aSourceString); + nsString unicodeStr; unicodeStr.AssignWithConversion(aSourceString); nsIUnicodeEncoder* encoder = nsnull; - aCharset.Assign("x-imap4-modified-utf7"); + aCharset.AssignWithConversion("x-imap4-modified-utf7"); res = ccm->GetUnicodeEncoder(&aCharset, &encoder); if(NS_SUCCEEDED(res) && (nsnull != encoder)) { @@ -473,7 +473,7 @@ CreateUtf7ConvertedString(const char * aSourceString, } } NS_IF_RELEASE(encoder); - nsString unicodeStr2(dstPtr); + nsString unicodeStr2; unicodeStr2.AssignWithConversion(dstPtr); convertedString = (char *) PR_Malloc(dstLength + 1); if (convertedString) unicodeStr2.ToCString(convertedString, dstLength + 1, 0); @@ -496,13 +496,13 @@ CreateUtf7ConvertedStringFromUnicode(const PRUnichar * aSourceString) if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsString aCharset("x-imap4-modified-utf7"); + nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); PRInt32 unicharLength; // convert from 8 bit ascii string to modified utf7 nsString unicodeStr(aSourceString); nsIUnicodeEncoder* encoder = nsnull; - aCharset.Assign("x-imap4-modified-utf7"); + aCharset.AssignWithConversion("x-imap4-modified-utf7"); res = ccm->GetUnicodeEncoder(&aCharset, &encoder); if(NS_SUCCEEDED(res) && (nsnull != encoder)) { @@ -544,7 +544,7 @@ nsresult CreateUnicodeStringFromUtf7(const char *aSourceString, PRUnichar **aUni if(NS_SUCCEEDED(res) && (nsnull != ccm)) { - nsString aCharset("x-imap4-modified-utf7"); + nsString aCharset; aCharset.AssignWithConversion("x-imap4-modified-utf7"); PRUnichar *unichars = nsnull; PRInt32 unicharLength;