diff --git a/mailnews/base/src/nsMessenger.cpp b/mailnews/base/src/nsMessenger.cpp index 5275a0cb4fd..65f016f7468 100644 --- a/mailnews/base/src/nsMessenger.cpp +++ b/mailnews/base/src/nsMessenger.cpp @@ -145,7 +145,7 @@ ConvertBufToPlainText(nsString &aConBuf) nsString convertedText; nsIParser *parser; - if (aConBuf == "") + if (aConBuf.IsEmpty()) return NS_OK; static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID); @@ -804,7 +804,7 @@ nsMessenger::SaveAs(const char* url, PRBool asFile, nsIMsgIdentity* identity, ns aListener->m_outputFormat = saveAsFileType == 1 ? TEXT_HTML : TEXT_PLAIN; // Mark the fact that we need to do charset handling/text conversion! - if (aListener->m_outputFormat == TEXT_PLAIN) + if (aListener->m_outputFormat.Equals(TEXT_PLAIN)) aListener->m_doCharsetConversion = PR_TRUE; channelSupport = do_QueryInterface(aListener->m_channel); @@ -1693,7 +1693,7 @@ nsSaveAsListener::OnStopRequest(nsIChannel* aChannel, nsISupports* aSupport, // If we need text/plain, then we need to convert the HTML and then convert // to the systems charset // - if (m_outputFormat == TEXT_PLAIN) + if (m_outputFormat.Equals(TEXT_PLAIN)) { ConvertBufToPlainText(m_msgBuffer); rv = nsMsgI18NSaveAsCharset(TEXT_PLAIN, (const char *)nsAutoCString(nsMsgI18NFileSystemCharset()), @@ -1754,7 +1754,7 @@ nsSaveAsListener::OnDataAvailable(nsIChannel* aChannel, // if (NS_SUCCEEDED(rv)) { - if ( (m_doCharsetConversion) && (m_outputFormat == TEXT_PLAIN) ) + if ( (m_doCharsetConversion) && (m_outputFormat.Equals(TEXT_PLAIN)) ) { PRUnichar *u = nsnull; nsAutoString fmt("%s"); diff --git a/mailnews/base/src/nsMsgAccount.cpp b/mailnews/base/src/nsMsgAccount.cpp index e18c9b72efa..e37d20ee795 100644 --- a/mailnews/base/src/nsMsgAccount.cpp +++ b/mailnews/base/src/nsMsgAccount.cpp @@ -130,7 +130,7 @@ nsMsgAccount::createIncomingServer() // get the servertype // ex) mail.server.myserver.type = imap nsCAutoString serverTypePref("mail.server."); - serverTypePref += serverKey; + serverTypePref.Append(serverKey); serverTypePref += ".type"; nsXPIDLCString serverType; diff --git a/mailnews/base/src/nsMsgAccountManager.cpp b/mailnews/base/src/nsMsgAccountManager.cpp index 9ae41a8e211..6814168a642 100644 --- a/mailnews/base/src/nsMsgAccountManager.cpp +++ b/mailnews/base/src/nsMsgAccountManager.cpp @@ -978,10 +978,10 @@ nsMsgAccountManager::getAccountList(nsISupports *element, void *aData) if (NS_FAILED(rv)) return PR_TRUE; if ((*accountList).IsEmpty()) - (*accountList) += key; + (*accountList).Append(key); else { (*accountList) += ','; - (*accountList) += key; + (*accountList).Append(key); } return PR_TRUE; diff --git a/mailnews/base/src/nsMsgAccountManagerDS.cpp b/mailnews/base/src/nsMsgAccountManagerDS.cpp index 0ff0bc3437a..9f03fa41ff4 100644 --- a/mailnews/base/src/nsMsgAccountManagerDS.cpp +++ b/mailnews/base/src/nsMsgAccountManagerDS.cpp @@ -244,7 +244,7 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source, nsXPIDLString prettyName; rv = folder->GetPrettyName(getter_Copies(prettyName)); if (NS_SUCCEEDED(rv)) - str = prettyName; + str.Assign(prettyName); } } } @@ -311,7 +311,7 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source, str = "ServerSettings"; } - if (str!="") + if (!str.IsEmpty()) rv = createNode(str, target, getRDFService()); //if we have an empty string and we don't have an error value, then //we don't have a value for RDF. diff --git a/mailnews/base/src/nsMsgMessageDataSource.cpp b/mailnews/base/src/nsMsgMessageDataSource.cpp index b43e316dbb0..bacae92d843 100644 --- a/mailnews/base/src/nsMsgMessageDataSource.cpp +++ b/mailnews/base/src/nsMsgMessageDataSource.cpp @@ -915,7 +915,7 @@ nsMsgMessageDataSource::createMessageNameNode(nsIMessage *message, if(NS_SUCCEEDED(rv) && (flags & MSG_FLAG_HAS_RE)) { nsAutoString reStr="Re: "; - reStr +=subject; + reStr.Append(subject); *((PRUnichar **)getter_Copies(subject)) = nsXPIDLString::Copy(reStr.GetUnicode()); } } diff --git a/mailnews/base/src/nsMsgNotificationManager.cpp b/mailnews/base/src/nsMsgNotificationManager.cpp index 8c46b8a3a51..a14242e1115 100644 --- a/mailnews/base/src/nsMsgNotificationManager.cpp +++ b/mailnews/base/src/nsMsgNotificationManager.cpp @@ -320,7 +320,7 @@ nsresult nsMsgNotificationManager::AddNewMailNotification(nsIMsgFolder *folder) if (NS_SUCCEEDED(rv) && folderName) { descriptionString += " in "; - descriptionString += folderName; + descriptionString.Append(folderName); } rv = rdfService->GetLiteral(descriptionString.GetUnicode(), getter_AddRefs(description)); diff --git a/mailnews/base/src/nsMsgViewNavigationService.cpp b/mailnews/base/src/nsMsgViewNavigationService.cpp index 9349825d3c2..83abc1a5765 100644 --- a/mailnews/base/src/nsMsgViewNavigationService.cpp +++ b/mailnews/base/src/nsMsgViewNavigationService.cpp @@ -62,7 +62,7 @@ static PRBool UnreadMessageNavigationFunction(nsIDOMXULElement *message, navigat nsAutoString resultStr; message->GetAttribute(unreadStr, resultStr); - return(resultStr == "true"); + return(resultStr.Equals("true")); } static PRBool FlaggedMessageNavigationFunction(nsIDOMXULElement *message, navigationInfoPtr info) @@ -71,7 +71,7 @@ static PRBool FlaggedMessageNavigationFunction(nsIDOMXULElement *message, naviga nsAutoString resultStr; message->GetAttribute(flaggedStr, resultStr); - return(resultStr == "flagged"); + return(resultStr.Equals("flagged")); } static PRBool NewMessageNavigationFunction(nsIDOMXULElement *message, navigationInfoPtr info) @@ -80,7 +80,7 @@ static PRBool NewMessageNavigationFunction(nsIDOMXULElement *message, navigation nsAutoString resultStr; message->GetAttribute(statusStr, resultStr); - return(resultStr == "new"); + return(resultStr.Equals("new")); } //resource functions @@ -113,7 +113,7 @@ static nsresult GetMessageValue(nsIRDFResource *message, nsString& propertyURI, rv = literal->GetValue(getter_Copies(valueStr)); if(NS_SUCCEEDED(rv)) - value = valueStr; + value.Assign(valueStr); } return rv; } @@ -134,7 +134,7 @@ static PRBool UnreadMessageNavigationResourceFunction(nsIRDFResource *message, n if(NS_FAILED(rv)) return PR_FALSE; - return(isUnreadValue == "true"); + return(isUnreadValue.Equals("true")); } static PRBool FlaggedMessageNavigationResourceFunction(nsIRDFResource *message, navigationInfoPtr info) @@ -147,7 +147,7 @@ static PRBool FlaggedMessageNavigationResourceFunction(nsIRDFResource *message, if(NS_FAILED(rv)) return PR_FALSE; - return(flaggedValue == "flagged"); + return(flaggedValue.Equals("flagged")); } static PRBool NewMessageNavigationResourceFunction(nsIRDFResource *message, navigationInfoPtr info) @@ -160,7 +160,7 @@ static PRBool NewMessageNavigationResourceFunction(nsIRDFResource *message, navi if(NS_FAILED(rv)) return PR_FALSE; - return(statusValue == "new"); + return(statusValue.Equals("new")); } //Thread navigation functions. @@ -415,7 +415,7 @@ NS_IMETHODIMP nsMsgViewNavigationService::FindFirstMessage(nsIDOMXULTreeElement if(NS_FAILED(rv)) return rv; - if(nodeName == "treechildren") + if(nodeName.Equals("treechildren")) { //Get the treechildren's first child. This is the first message nsCOMPtr firstChild; @@ -606,7 +606,7 @@ nsresult nsMsgViewNavigationService::FindNextMessageInThreads(nsIDOMNode *startM return rv; //if we're on the top level and a thread function has been passed in, we might be able to search faster. - if(parentNodeName != "treeitem" && info->navThreadFunction) + if(!parentNodeName.Equals("treeitem") && info->navThreadFunction) { return GetNextMessageByThread(startElement, info, nextMessage); @@ -681,7 +681,7 @@ nsresult nsMsgViewNavigationService::FindNextInChildren(nsIDOMNode *parent, navi if(NS_FAILED(rv)) return rv; - isParentOpen = (openResult == "true"); + isParentOpen = (openResult.Equals("true")); //First we'll deal with the case where the parent is open. In this case we can use DOM calls. if(isParentOpen) { @@ -909,7 +909,7 @@ NS_IMETHODIMP nsMsgViewNavigationService::OpenTreeitemAndDescendants(nsIDOMNode if(NS_FAILED(rv)) return rv; - if(nodeName == "treechildren") + if(nodeName.Equals("treechildren")) { nsCOMPtr treechildrenChildNodes; rv = treeitemChild->GetChildNodes(getter_AddRefs(treechildrenChildNodes)); @@ -930,7 +930,7 @@ NS_IMETHODIMP nsMsgViewNavigationService::OpenTreeitemAndDescendants(nsIDOMNode nsAutoString treechildrenChildNodeName; rv = treechildrenChild->GetNodeName(treechildrenChildNodeName); - if(treechildrenChildNodeName == "treeitem") + if(treechildrenChildNodeName.Equals("treeitem")) { nsCOMPtr childElement = do_QueryInterface(treechildrenChild); if(!childElement) @@ -1221,7 +1221,7 @@ nsresult nsMsgViewNavigationService::FindNextInAncestors(nsIDOMNode *startMessag if(NS_FAILED(rv)) return rv; - while(parentNodeName == "treeitem") + while(parentNodeName.Equals("treeitem")) { nsCOMPtr nextSibling; rv = parent->GetNextSibling(getter_AddRefs(nextSibling));