From e1a68dd7f09789d046aa253181aa950a7f79f882 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Fri, 5 Mar 2004 18:54:14 +0000 Subject: [PATCH] patch for bug 234908 "getter_Copies scoping problem" r+sr=bienvenu --- mailnews/compose/src/nsSmtpUrl.cpp | 18 +++++++++--------- mailnews/imap/src/nsImapIncomingServer.cpp | 8 +++++--- mailnews/imap/src/nsImapMailFolder.cpp | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/mailnews/compose/src/nsSmtpUrl.cpp b/mailnews/compose/src/nsSmtpUrl.cpp index 7701d1bd97f..11b99696663 100644 --- a/mailnews/compose/src/nsSmtpUrl.cpp +++ b/mailnews/compose/src/nsSmtpUrl.cpp @@ -195,7 +195,7 @@ nsresult nsMailtoUrl::ParseMailtoUrl(char * searchPart) } // if rest && *rest nsCOMPtr mimeConverter = do_GetService(NS_MIME_CONVERTER_CONTRACTID); - nsXPIDLCString decodedString; + char *decodedString; // Now unescape any fields that need escaped... if (!m_toPart.IsEmpty()) @@ -204,10 +204,10 @@ nsresult nsMailtoUrl::ParseMailtoUrl(char * searchPart) if (mimeConverter) { if (NS_SUCCEEDED(mimeConverter->DecodeMimeHeader(m_toPart.get(), - getter_Copies(decodedString), + &decodedString, "UTF-8", PR_FALSE)) && decodedString) - m_toPart = decodedString; + m_toPart.Adopt(decodedString); } } if (!m_ccPart.IsEmpty()) @@ -216,10 +216,10 @@ nsresult nsMailtoUrl::ParseMailtoUrl(char * searchPart) if (mimeConverter) { if (NS_SUCCEEDED(mimeConverter->DecodeMimeHeader(m_ccPart.get(), - getter_Copies(decodedString), + &decodedString, "UTF-8", PR_FALSE)) && decodedString) - m_ccPart = decodedString; + m_ccPart.Adopt(decodedString); } } if (!m_subjectPart.IsEmpty()) @@ -228,10 +228,10 @@ nsresult nsMailtoUrl::ParseMailtoUrl(char * searchPart) if (mimeConverter) { if (NS_SUCCEEDED(mimeConverter->DecodeMimeHeader(m_subjectPart.get(), - getter_Copies(decodedString), + &decodedString, "UTF-8", PR_FALSE)) && decodedString) - m_subjectPart = decodedString; + m_subjectPart.Adopt(decodedString); } } if (!m_newsgroupPart.IsEmpty()) @@ -244,11 +244,11 @@ nsresult nsMailtoUrl::ParseMailtoUrl(char * searchPart) if (mimeConverter) { if (NS_SUCCEEDED(mimeConverter->DecodeMimeHeader(m_bodyPart.get(), - getter_Copies(decodedString), + &decodedString, "UTF-8", PR_FALSE, PR_FALSE)) && decodedString) - m_bodyPart = decodedString; + m_bodyPart.Adopt(decodedString); } } if (!m_newsHostPart.IsEmpty()) diff --git a/mailnews/imap/src/nsImapIncomingServer.cpp b/mailnews/imap/src/nsImapIncomingServer.cpp index 8e69954f780..4232bbb06f8 100644 --- a/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mailnews/imap/src/nsImapIncomingServer.cpp @@ -1749,9 +1749,11 @@ NS_IMETHODIMP nsImapIncomingServer::DiscoveryDone() for (PRUint32 i = 0; i < numFolders; i++) { nsXPIDLString folderName; - if (NS_SUCCEEDED(trashFolders[i]->GetName(getter_Copies(folderName))) && - !folderName.Equals(trashName)) - trashFolders[i]->ClearFlag(MSG_FOLDER_FLAG_TRASH); + if (NS_SUCCEEDED(trashFolders[i]->GetName(getter_Copies(folderName)))) + { + if (!folderName.Equals(trashName)) + trashFolders[i]->ClearFlag(MSG_FOLDER_FLAG_TRASH); + } NS_RELEASE(trashFolders[i]); } diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 05868d93271..8ef61bc11af 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -4084,9 +4084,9 @@ nsresult nsImapMailFolder::SyncFlags(nsIImapFlagAndUidState *flagState) if (flags & kImapMsgCustomKeywordFlag) { nsXPIDLCString keywords; - if (NS_SUCCEEDED(flagState->GetCustomFlags(uidOfMessage, getter_Copies(keywords))) && !keywords.IsEmpty()) + if (NS_SUCCEEDED(flagState->GetCustomFlags(uidOfMessage, getter_Copies(keywords)))) { - if (dbHdr && NS_SUCCEEDED(rv)) + if (!keywords.IsEmpty() && dbHdr && NS_SUCCEEDED(rv)) { HandleCustomFlags(uidOfMessage, dbHdr, keywords); }