зеркало из https://github.com/mozilla/pjs.git
small changes to clients of string converting APIs
This commit is contained in:
Родитель
baf5b30589
Коммит
1ccfd56d21
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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<nsIDOMNode> 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<nsIDOMNodeList> 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<nsIDOMElement> 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<nsIDOMNode> nextSibling;
|
||||
rv = parent->GetNextSibling(getter_AddRefs(nextSibling));
|
||||
|
|
Загрузка…
Ссылка в новой задаче