зеркало из https://github.com/mozilla/pjs.git
Bug #379070 --> remove XPIDLString and other string APIs which aren't available when using frozen linkage from mailnews.
sr=bienvenu
This commit is contained in:
Родитель
11153071e7
Коммит
a90fad2ac3
|
@ -199,7 +199,7 @@ RegisterMailnewsContentPolicy(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
|||
nsCOMPtr<nsICategoryManager> catman =
|
||||
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsXPIDLCString previous;
|
||||
nsCString previous;
|
||||
return catman->AddCategoryEntry("content-policy",
|
||||
NS_MSGCONTENTPOLICY_CONTRACTID,
|
||||
NS_MSGCONTENTPOLICY_CONTRACTID,
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
nsCOMPtr<nsISupportsArray> m_searchTerms; /* linked list of criteria terms */
|
||||
|
||||
PRBool m_abortCalled;
|
||||
nsXPIDLString m_defaultCharset;
|
||||
nsString m_defaultCharset;
|
||||
PRBool m_forceAsciiSearch;
|
||||
|
||||
static nsresult EncodeImap (char **ppEncoding,
|
||||
|
|
|
@ -322,7 +322,7 @@ nsMsgFilterDataSource::getFilterListTargets(nsIMsgFilterList *aFilterList,
|
|||
aResult->AppendElement(filterResource);
|
||||
|
||||
// now reduce the URI back to the base uri
|
||||
filterUri.Truncate(baseFilterUriLength);
|
||||
filterUri.SetLength(baseFilterUriLength);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -202,7 +202,7 @@ nsMsgFilterDelegateFactory::getFilterList(const char *aUri,
|
|||
// now we actually need the filter list, so we truncate the string
|
||||
// and use getdelegate to get the filter delegate
|
||||
nsCAutoString folderUri((const char*)aUri);
|
||||
folderUri.Truncate(aTagPosition);
|
||||
folderUri.SetLength(aTagPosition);
|
||||
|
||||
// convert URI to resource
|
||||
nsCOMPtr<nsIRDFService> rdf(do_GetService(kRDFServiceCID, &rv));
|
||||
|
|
|
@ -574,7 +574,7 @@ nsresult nsMsgFilterList::LoadTextFilters(nsIInputStream *aStream)
|
|||
PRInt32 nextFilterStartPos = m_unparsedFilterBuffer.RFind("name");
|
||||
nsCAutoString nextFilterPart;
|
||||
nextFilterPart = Substring(m_unparsedFilterBuffer, nextFilterStartPos, m_unparsedFilterBuffer.Length());
|
||||
m_unparsedFilterBuffer.Truncate(nextFilterStartPos);
|
||||
m_unparsedFilterBuffer.SetLength(nextFilterStartPos);
|
||||
|
||||
PRBool unparseableFilter;
|
||||
m_curFilter->GetUnparseable(&unparseableFilter);
|
||||
|
|
|
@ -656,9 +656,7 @@ nsresult nsMsgFilterAfterTheFact::ApplyFilter()
|
|||
m_searchHitHdrs->QueryElementAt(msgIndex, NS_GET_IID(nsIMsgDBHdr), getter_AddRefs(msgHdr));
|
||||
if (msgHdr)
|
||||
{
|
||||
nsAutoString forwardStr;
|
||||
forwardStr.AssignWithConversion(forwardTo.get());
|
||||
rv = compService->ForwardMessage(forwardStr, msgHdr, m_msgWindow, server);
|
||||
rv = compService->ForwardMessage(NS_ConvertASCIItoUTF16(forwardTo), msgHdr, m_msgWindow, server);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ char *nsMsgSearchNews::EncodeTerm (nsIMsgSearchTerm *term)
|
|||
|
||||
if (leadingStar)
|
||||
pattern.Append('*');
|
||||
AppendUTF16toUTF8(escapedValue, pattern);
|
||||
pattern.Append(NS_ConvertUTF16toUTF8(escapedValue));
|
||||
if (trailingStar)
|
||||
pattern.Append('*');
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ nsMsgSearchValueImpl::ToString(nsAString &aResult)
|
|||
{
|
||||
aResult.AssignLiteral("[nsIMsgSearchValue: ");
|
||||
if (IS_STRING_ATTRIBUTE(mValue.attribute)) {
|
||||
AppendUTF8toUTF16(mValue.string, aResult);
|
||||
aResult.Append(NS_ConvertUTF8toUTF16(mValue.string));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "nsIRDFNode.h"
|
||||
#include "nsRDFCID.h"
|
||||
#include "nsIMsgImapMailFolder.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIMsgMessageService.h"
|
||||
#include "nsMsgUtils.h"
|
||||
#include "netCore.h"
|
||||
|
@ -73,15 +72,15 @@ static nsresult GetMessage(nsIURI *aURL, nsIMsgDBHdr **message)
|
|||
|
||||
// get the uri. first try and use the original message spec
|
||||
// if that fails, use the spec of nsIURI that we're called with
|
||||
nsXPIDLCString uri;
|
||||
nsCString uri;
|
||||
rv = uriURL->GetOriginalSpec(getter_Copies(uri));
|
||||
if (NS_FAILED(rv) || uri.IsEmpty()) {
|
||||
rv = uriURL->GetUri(getter_Copies(uri));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
|
||||
nsCOMPtr <nsIMsgMessageService> msgMessageService;
|
||||
rv = GetMessageServiceFromURI(uri, getter_AddRefs(msgMessageService));
|
||||
rv = GetMessageServiceFromURI(uri.get(), getter_AddRefs(msgMessageService));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
if (!msgMessageService)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsIStringStream.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
|
@ -456,7 +455,7 @@ nsMessenger::PromptIfFileExists(nsILocalFile *file)
|
|||
if (!dialog) return rv;
|
||||
nsAutoString path;
|
||||
PRBool dialogResult = PR_FALSE;
|
||||
nsXPIDLString errorMessage;
|
||||
nsString errorMessage;
|
||||
|
||||
file->GetPath(path);
|
||||
const PRUnichar *pathFormatStrings[] = { path.get() };
|
||||
|
@ -470,7 +469,7 @@ nsMessenger::PromptIfFileExists(nsILocalFile *file)
|
|||
pathFormatStrings, 1,
|
||||
getter_Copies(errorMessage));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = dialog->Confirm(nsnull, errorMessage, &dialogResult);
|
||||
rv = dialog->Confirm(nsnull, errorMessage.get(), &dialogResult);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (dialogResult)
|
||||
|
@ -828,7 +827,7 @@ nsMessenger::SaveAttachmentToFolder(const char * contentType, const char * url,
|
|||
|
||||
nsCOMPtr<nsILocalFile> attachmentDestination = do_QueryInterface(clone);
|
||||
|
||||
nsXPIDLCString unescapedFileName;
|
||||
nsCString unescapedFileName;
|
||||
rv = ConvertAndSanitizeFileName(displayName, nsnull, getter_Copies(unescapedFileName));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -836,7 +835,6 @@ nsMessenger::SaveAttachmentToFolder(const char * contentType, const char * url,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = SaveAttachment(attachmentDestination, url, messageUri, contentType, nsnull);
|
||||
|
||||
attachmentDestination.swap(*aOutFile);
|
||||
return rv;
|
||||
}
|
||||
|
@ -860,10 +858,8 @@ nsMessenger::SaveAttachment(const char * contentType, const char * url,
|
|||
PRInt16 dialogResult;
|
||||
nsCOMPtr<nsILocalFile> localFile;
|
||||
nsCOMPtr<nsILocalFile> lastSaveDir;
|
||||
nsXPIDLCString filePath;
|
||||
|
||||
|
||||
nsXPIDLString defaultDisplayString;
|
||||
nsCString filePath;
|
||||
nsString defaultDisplayString;
|
||||
rv = ConvertAndSanitizeFileName(displayName, getter_Copies(defaultDisplayString), nsnull);
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
|
@ -918,7 +914,7 @@ nsMessenger::SaveAllAttachments(PRUint32 count,
|
|||
do_CreateInstance("@mozilla.org/filepicker;1", &rv);
|
||||
nsCOMPtr<nsILocalFile> localFile;
|
||||
nsCOMPtr<nsILocalFile> lastSaveDir;
|
||||
nsXPIDLCString dirName;
|
||||
nsCString dirName;
|
||||
nsSaveAllAttachmentsState *saveState = nsnull;
|
||||
PRInt16 dialogResult;
|
||||
|
||||
|
@ -952,9 +948,9 @@ nsMessenger::SaveAllAttachments(PRUint32 count,
|
|||
urlArray,
|
||||
displayNameArray,
|
||||
messageUriArray,
|
||||
(const char*) dirName, detaching);
|
||||
dirName.get(), detaching);
|
||||
{
|
||||
nsXPIDLCString unescapedName;
|
||||
nsCString unescapedName;
|
||||
rv = ConvertAndSanitizeFileName(displayNameArray[0], nsnull, getter_Copies(unescapedName));
|
||||
if (NS_FAILED(rv))
|
||||
goto done;
|
||||
|
@ -2015,7 +2011,7 @@ nsSaveMsgListener::OnStopRequest(nsIRequest* request, nsISupports* aSupport,
|
|||
{
|
||||
nsSaveAllAttachmentsState *state = m_saveAllAttachmentsState;
|
||||
PRUint32 i = state->m_curIndex;
|
||||
nsXPIDLCString unescapedName;
|
||||
nsCString unescapedName;
|
||||
nsCOMPtr<nsILocalFile> localFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
rv = localFile->InitWithNativePath(nsDependentCString(state->m_directoryName));
|
||||
|
@ -2110,8 +2106,7 @@ nsSaveMsgListener::OnDataAvailable(nsIRequest* request,
|
|||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
if ( (m_doCharsetConversion) && (m_outputFormat == ePlainText) )
|
||||
AppendUTF8toUTF16(Substring(m_dataBuffer, m_dataBuffer + readCount),
|
||||
m_msgBuffer);
|
||||
m_msgBuffer.Append(NS_ConvertUTF8toUTF16(Substring(m_dataBuffer, m_dataBuffer + readCount)));
|
||||
else
|
||||
rv = m_outputStream->Write(m_dataBuffer, readCount, &writeCount);
|
||||
|
||||
|
@ -3153,8 +3148,8 @@ nsMessenger::PromptIfDeleteAttachments(PRBool aSaveFirst,
|
|||
}
|
||||
|
||||
// create the list of attachments we are removing
|
||||
nsXPIDLString displayString;
|
||||
nsXPIDLString attachmentList;
|
||||
nsString displayString;
|
||||
nsString attachmentList;
|
||||
for (PRUint32 u = 0; u < aCount; ++u)
|
||||
{
|
||||
rv = ConvertAndSanitizeFileName(aDisplayNameArray[u], getter_Copies(displayString), nsnull);
|
||||
|
@ -3165,14 +3160,14 @@ nsMessenger::PromptIfDeleteAttachments(PRBool aSaveFirst,
|
|||
const PRUnichar *formatStrings[] = { attachmentList.get() };
|
||||
|
||||
// format the message and display
|
||||
nsXPIDLString promptMessage;
|
||||
nsString promptMessage;
|
||||
const PRUnichar * propertyName = aSaveFirst ?
|
||||
NS_LITERAL_STRING("detachAttachments").get() : NS_LITERAL_STRING("deleteAttachments").get();
|
||||
rv = mStringBundle->FormatStringFromName(propertyName, formatStrings, 1,getter_Copies(promptMessage));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool dialogResult = PR_FALSE;
|
||||
rv = dialog->Confirm(nsnull, promptMessage, &dialogResult);
|
||||
rv = dialog->Confirm(nsnull, promptMessage.get(), &dialogResult);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return dialogResult ? NS_OK : NS_ERROR_FAILURE;
|
||||
|
|
|
@ -264,7 +264,7 @@ NS_IMETHODIMP nsMessengerBootstrap::OpenMessengerWindowWithUri(const char *windo
|
|||
#ifdef MOZ_XUL_APP
|
||||
NS_NAMED_LITERAL_CSTRING(chromeurl, "chrome://messenger/content/");
|
||||
#else
|
||||
nsXPIDLCString chromeurl;
|
||||
nsCString chromeurl;
|
||||
rv = GetChromeUrlForTask(getter_Copies(chromeurl));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
|
|
@ -112,7 +112,7 @@ static void openMailWindow(const nsACString& aFolderUri)
|
|||
// (and add code to the messenger window service to make that work)
|
||||
if (messengerWindowService)
|
||||
messengerWindowService->OpenMessengerWindowWithUri(
|
||||
"mail:3pane", PromiseFlatCString(aFolderUri).get(), nsMsgKey_None);
|
||||
"mail:3pane", nsCString(aFolderUri).get(), nsMsgKey_None);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ static void openMailWindow(const nsACString& aFolderUri)
|
|||
// (and add code to the messenger window service to make that work)
|
||||
if (messengerWindowService)
|
||||
messengerWindowService->OpenMessengerWindowWithUri(
|
||||
"mail:3pane", PromiseFlatCString(aFolderUri).get(), nsMsgKey_None);
|
||||
"mail:3pane", nsCString(aFolderUri).get(), nsMsgKey_None);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ nsMsgAccount::AddIdentity(nsIMsgIdentity *identity)
|
|||
identitiesKeyPref.Append(m_accountKey);
|
||||
identitiesKeyPref.Append(".identities");
|
||||
|
||||
nsXPIDLCString identityList;
|
||||
nsCString identityList;
|
||||
m_prefs->GetCharPref(identitiesKeyPref.get(),
|
||||
getter_Copies(identityList));
|
||||
|
||||
|
|
|
@ -1440,7 +1440,7 @@ nsMsgAccountManager::UnloadAccounts()
|
|||
m_identities.Reset(hashElementRelease, nsnull);
|
||||
m_incomingServers.Reset(hashElementRelease, nsnull);
|
||||
m_accountsLoaded = PR_FALSE;
|
||||
mAccountKeyList.Truncate(0);
|
||||
mAccountKeyList.Truncate();
|
||||
SetLastServerFound(nsnull, EmptyCString(), EmptyCString(), 0, EmptyCString());
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2784,7 +2784,7 @@ NS_IMETHODIMP nsMsgAccountManager::LoadVirtualFolders()
|
|||
// has its parent set.
|
||||
parentFolder->GetParent(getter_AddRefs(grandParent));
|
||||
parentFolder->GetIsServer(&isServer);
|
||||
buffer.Truncate(lastSlash);
|
||||
buffer.SetLength(lastSlash);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
|
|
@ -42,16 +42,12 @@
|
|||
*/
|
||||
|
||||
#include "nsMsgAccountManagerDS.h"
|
||||
|
||||
|
||||
#include "rdf.h"
|
||||
#include "nsRDFCID.h"
|
||||
#include "nsIRDFDataSource.h"
|
||||
#include "nsEnumeratorUtils.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIMsgMailSession.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
#include "nsMsgRDFUtils.h"
|
||||
#include "nsIMsgFolder.h"
|
||||
#include "nsMsgBaseCID.h"
|
||||
|
@ -549,7 +545,7 @@ nsMsgAccountManagerDataSource::GetTarget(nsIRDFResource *source,
|
|||
// allow for the accountmanager to be dynamically extended
|
||||
// all the other pages come after the standard ones
|
||||
// server, copies, addressing, disk space (or offline & disk space)
|
||||
str.AssignWithConversion(sourceValue);
|
||||
CopyASCIItoUTF16(sourceValue, str);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -640,19 +636,6 @@ nsMsgAccountManagerDataSource::GetTargets(nsIRDFResource *source,
|
|||
rv = NS_NewArrayEnumerator(_retval, nodes);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#ifdef DEBUG_amds
|
||||
nsXPIDLCString source_value;
|
||||
rv = source->GetValue(getter_Copies(source_value));
|
||||
|
||||
nsXPIDLCString property_arc;
|
||||
rv = property->GetValue(getter_Copies(property_arc));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
printf("GetTargets(%s with arc %s...)\n",
|
||||
(const char*)source_value,
|
||||
(const char*)property_arc);
|
||||
#endif
|
||||
|
||||
if (source == kNC_AccountRoot)
|
||||
rv = createRootResources(property, nodes);
|
||||
else if (property == kNC_Settings)
|
||||
|
@ -730,7 +713,7 @@ nsMsgAccountManagerDataSource::appendGenericSettingsResources(nsIMsgIncomingServ
|
|||
if (NS_FAILED(rv))
|
||||
break;
|
||||
|
||||
nsXPIDLCString contractidString;
|
||||
nsCString contractidString;
|
||||
rv = catman->GetCategoryEntry(MAILNEWS_ACCOUNTMANAGER_EXTENSIONS, entryString.get(), getter_Copies(contractidString));
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
|
@ -1244,12 +1227,6 @@ nsMsgAccountManagerDataSource::OnServerLoaded(nsIMsgIncomingServer* aServer)
|
|||
nsCOMPtr<nsIRDFResource> serverResource = do_QueryInterface(serverFolder,&rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#ifdef DEBUG_alecf_
|
||||
nsXPIDLCString serverUri;
|
||||
serverResource->GetValue(getter_Copies(serverUri));
|
||||
printf("nsMsgAccountmanagerDataSource::OnServerLoaded(%s)\n", (const char*)serverUri);
|
||||
#endif
|
||||
|
||||
NotifyObservers(kNC_AccountRoot, kNC_Child, serverResource, nsnull, PR_TRUE, PR_FALSE);
|
||||
NotifyObservers(kNC_AccountRoot, kNC_Settings, serverResource, nsnull, PR_TRUE, PR_FALSE);
|
||||
|
||||
|
@ -1354,7 +1331,7 @@ nsMsgAccountManagerDataSource::IsFakeAccountRequired()
|
|||
if (!showFakeAccount)
|
||||
return PR_FALSE;
|
||||
|
||||
nsXPIDLCString fakeHostName;
|
||||
nsCString fakeHostName;
|
||||
rv = GetFakeAccountHostName(getter_Copies(fakeHostName));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
@ -1380,7 +1357,7 @@ nsMsgAccountManagerDataSource::IsIncomingServerForFakeAccount(nsIMsgIncomingServ
|
|||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
nsresult rv;
|
||||
nsXPIDLCString fakeAccountHostName;
|
||||
nsCString fakeAccountHostName;
|
||||
rv = GetFakeAccountHostName(getter_Copies(fakeAccountHostName));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
|
|
@ -144,15 +144,15 @@ nsresult nsMsgContentPolicy::AllowRemoteContentForSender(nsIMsgDBHdr * aMsgHdr,
|
|||
*aAllowForSender = PR_FALSE;
|
||||
|
||||
// extract the e-mail address from the msg hdr
|
||||
nsXPIDLCString author;
|
||||
nsCString author;
|
||||
rv = aMsgHdr->GetAuthor(getter_Copies(author));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgHeaderParser> headerParser = do_GetService("@mozilla.org/messenger/headerparser;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsXPIDLCString emailAddress;
|
||||
rv = headerParser->ExtractHeaderAddressMailboxes(nsnull, author, getter_Copies(emailAddress));
|
||||
nsCString emailAddress;
|
||||
rv = headerParser->ExtractHeaderAddressMailboxes(nsnull, author.get(), getter_Copies(emailAddress));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Use the RDF service to walk through the list of local directories
|
||||
|
@ -181,7 +181,7 @@ nsresult nsMsgContentPolicy::AllowRemoteContentForSender(nsIMsgDBHdr * aMsgHdr,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mdbDirectory = do_QueryInterface(supports);
|
||||
if (mdbDirectory)
|
||||
mdbDirectory->CardForEmailAddress(emailAddress, getter_AddRefs(cardForAddress));
|
||||
mdbDirectory->CardForEmailAddress(emailAddress.get(), getter_AddRefs(cardForAddress));
|
||||
}
|
||||
|
||||
// if we found a card from the sender,
|
||||
|
@ -424,7 +424,7 @@ nsresult nsMsgContentPolicy::MailShouldLoad(nsIURI * aRequestingLocation, nsIURI
|
|||
nsCOMPtr<nsIMsgMessageUrl> msgUrl = do_QueryInterface(aRequestingLocation, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsXPIDLCString resourceURI;
|
||||
nsCString resourceURI;
|
||||
msgUrl->GetUri(getter_Copies(resourceURI));
|
||||
|
||||
// get the msg service for this URI
|
||||
|
@ -433,7 +433,7 @@ nsresult nsMsgContentPolicy::MailShouldLoad(nsIURI * aRequestingLocation, nsIURI
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgDBHdr> msgHdr;
|
||||
rv = msgService->MessageURIToMsgHdr(resourceURI, getter_AddRefs(msgHdr));
|
||||
rv = msgService->MessageURIToMsgHdr(resourceURI.get(), getter_AddRefs(msgHdr));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aRequestingLocation, &rv);
|
||||
|
@ -480,7 +480,7 @@ nsresult nsMsgContentPolicy::ComposeShouldLoad(nsIDocShell * aRootDocShell, nsIS
|
|||
rv = composeService->GetMsgComposeForWindow(window, getter_AddRefs(msgCompose));
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
|
||||
nsXPIDLCString originalMsgURI;
|
||||
nsCString originalMsgURI;
|
||||
msgCompose->GetOriginalMsgURI(getter_Copies(originalMsgURI));
|
||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||
|
||||
|
|
|
@ -438,7 +438,6 @@ nsresult nsMsgDBView::FetchSubject(nsIMsgDBHdr * aMsgHdr, PRUint32 aFlags, nsASt
|
|||
}
|
||||
else
|
||||
aMsgHdr->GetMime2DecodedSubject(getter_Copies(aValue));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ nsresult nsMsgFolderCache::OpenMDB(const nsACString& dbName, PRBool exists)
|
|||
mdbYarn outFormatVersion;
|
||||
|
||||
nsIMdbFile* oldFile = 0;
|
||||
ret = myMDBFactory->OpenOldFile(m_mdbEnv, dbHeap, PromiseFlatCString(dbName).get(),
|
||||
ret = myMDBFactory->OpenOldFile(m_mdbEnv, dbHeap, nsCString(dbName).get(),
|
||||
dbFrozen, &oldFile);
|
||||
if ( oldFile )
|
||||
{
|
||||
|
@ -235,7 +235,7 @@ nsresult nsMsgFolderCache::OpenMDB(const nsACString& dbName, PRBool exists)
|
|||
else // ### need error code saying why open file store failed
|
||||
{
|
||||
nsIMdbFile* newFile = 0;
|
||||
ret = myMDBFactory->CreateNewFile(m_mdbEnv, dbHeap, PromiseFlatCString(dbName).get(), &newFile);
|
||||
ret = myMDBFactory->CreateNewFile(m_mdbEnv, dbHeap, nsCString(dbName).get(), &newFile);
|
||||
if ( newFile )
|
||||
{
|
||||
if (NS_SUCCEEDED(ret))
|
||||
|
@ -293,7 +293,7 @@ NS_IMETHODIMP nsMsgFolderCache::GetCacheElement(const nsACString& pathKey, PRBoo
|
|||
NS_ENSURE_ARG_POINTER(result);
|
||||
NS_ENSURE_TRUE(m_cacheElements, NS_ERROR_FAILURE);
|
||||
|
||||
nsCStringKey hashKey(PromiseFlatCString(pathKey).get());
|
||||
nsCStringKey hashKey(nsCString(pathKey).get());
|
||||
*result = (nsIMsgFolderCacheElement *) m_cacheElements->Get(&hashKey);
|
||||
|
||||
// nsHashTable already does an address on *result
|
||||
|
@ -323,7 +323,7 @@ NS_IMETHODIMP nsMsgFolderCache::GetCacheElement(const nsACString& pathKey, PRBoo
|
|||
|
||||
NS_IMETHODIMP nsMsgFolderCache::RemoveElement(const nsACString& key)
|
||||
{
|
||||
nsCStringKey hashKey(PromiseFlatCString(key).get());
|
||||
nsCStringKey hashKey(nsCString(key).get());
|
||||
nsCOMPtr <nsISupports> supports = getter_AddRefs(m_cacheElements->Get(&hashKey));
|
||||
if (!supports)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -130,7 +130,7 @@ NS_IMETHODIMP nsMsgFolderCacheElement::SetStringProperty(const char *propertyNam
|
|||
yarn.mYarn_Grow = NULL;
|
||||
if (m_mdbRow)
|
||||
{
|
||||
yarn.mYarn_Buf = (void *) PromiseFlatCString(propertyValue).get();
|
||||
yarn.mYarn_Buf = (void *) nsCString(propertyValue).get();
|
||||
yarn.mYarn_Size = strlen((const char *) yarn.mYarn_Buf) + 1;
|
||||
yarn.mYarn_Fill = yarn.mYarn_Size - 1;
|
||||
yarn.mYarn_Form = 0; // what to do with this? we're storing csid in the msg hdr...
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
|
||||
#include "msgCore.h" // precompiled header...
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIMsgFolder.h"
|
||||
#include "nsIMsgFolder.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIMsgHdr.h"
|
||||
|
@ -376,7 +375,7 @@ nsFolderCompactState::FinishCompact()
|
|||
folderPath->SetFollowLinks(PR_TRUE);
|
||||
GetSummaryFileLocation(folderPath, getter_AddRefs(summaryFile));
|
||||
|
||||
nsXPIDLCString leafName;
|
||||
nsCString leafName;
|
||||
summaryFile->GetNativeLeafName(leafName);
|
||||
nsCAutoString dbName(leafName);
|
||||
|
||||
|
@ -607,7 +606,7 @@ nsFolderCompactState::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
|
|||
PRBool addKeywordHdr = PR_FALSE;
|
||||
PRUint32 needToGrowKeywords = 0;
|
||||
PRUint32 statusOffset;
|
||||
nsXPIDLCString msgHdrKeywords;
|
||||
nsCString msgHdrKeywords;
|
||||
|
||||
if (m_startOfMsg)
|
||||
{
|
||||
|
@ -915,8 +914,7 @@ nsOfflineStoreCompactState::FinishCompact()
|
|||
m_folder->GetFlags(&flags);
|
||||
rv = m_folder->GetFilePath(getter_AddRefs(path));
|
||||
|
||||
nsXPIDLCString leafName;
|
||||
|
||||
nsCString leafName;
|
||||
path->GetNativeLeafName(leafName);
|
||||
|
||||
// close down the temp file stream; preparing for deleting the old folder
|
||||
|
|
|
@ -39,8 +39,7 @@
|
|||
#define _nsMsgFolderCompactor_h
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIMsgFolder.h"
|
||||
#include "nsIMsgFolder.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIMsgFolderCompactor.h"
|
||||
#include "nsICopyMsgStreamListener.h"
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
#include "nsIMsgMailSession.h"
|
||||
|
@ -435,23 +434,7 @@ NS_IMETHODIMP nsMsgFolderDataSource::GetTarget(nsIRDFResource* source,
|
|||
|
||||
nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source));
|
||||
if (folder)
|
||||
{
|
||||
rv = createFolderNode(folder, property, target);
|
||||
#if 0
|
||||
nsXPIDLCString srcval;
|
||||
nsXPIDLCString propval;
|
||||
nsXPIDLCString targetval;
|
||||
source->GetValue(getter_Copies(srcval));
|
||||
property->GetValue(getter_Copies(propval));
|
||||
// (*target)->GetValue(getter_Copies(targetval));
|
||||
|
||||
printf("nsMsgFolderDataSource::GetTarget(%s, %s, %s, (%s))\n",
|
||||
(const char*)srcval,
|
||||
(const char*)propval, tv ? "TRUE" : "FALSE",
|
||||
(const char*)"");
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
return NS_RDF_NO_VALUE;
|
||||
return rv;
|
||||
|
@ -475,19 +458,6 @@ NS_IMETHODIMP nsMsgFolderDataSource::GetTargets(nsIRDFResource* source,
|
|||
if(!targets)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
#if 0
|
||||
nsXPIDLCString srcval;
|
||||
nsXPIDLCString propval;
|
||||
nsXPIDLCString targetval;
|
||||
source->GetValue(getter_Copies(srcval));
|
||||
property->GetValue(getter_Copies(propval));
|
||||
// (*target)->GetValue(getter_Copies(targetval));
|
||||
|
||||
printf("nsMsgFolderDataSource::GetTargets(%s, %s, %s, (%s))\n",
|
||||
(const char*)srcval,
|
||||
(const char*)propval, tv ? "TRUE" : "FALSE",
|
||||
(const char*)"");
|
||||
#endif
|
||||
*targets = nsnull;
|
||||
|
||||
nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
|
||||
|
@ -577,16 +547,6 @@ NS_IMETHODIMP nsMsgFolderDataSource::HasAssertion(nsIRDFResource* source,
|
|||
PRBool* hasAssertion)
|
||||
{
|
||||
nsresult rv;
|
||||
#if 0
|
||||
nsXPIDLCString sourceval;
|
||||
nsXPIDLCString propval;
|
||||
nsXPIDLCString targetval;
|
||||
source->GetValue(getter_Copies(sourceval));
|
||||
property->GetValue(getter_Copies(propval));
|
||||
/* target->GetValue(getter_Copies(targetval)); */
|
||||
printf("HasAssertion(%s, %s, ??...)\n", (const char*)sourceval, (const char*)propval);
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
|
||||
if(NS_SUCCEEDED(rv))
|
||||
return DoFolderHasAssertion(folder, property, target, tv, hasAssertion);
|
||||
|
@ -2108,8 +2068,7 @@ nsresult nsMsgFolderDataSource::DoDeleteFromFolder(
|
|||
NS_ENSURE_ARG_POINTER(msgWindow);
|
||||
nsCOMPtr<nsIStringBundleService> sBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
|
||||
nsCOMPtr<nsIStringBundle> sMessengerStringBundle;
|
||||
nsXPIDLString confirmMsg;
|
||||
|
||||
nsString confirmMsg;
|
||||
if (NS_SUCCEEDED(rv) && sBundleService)
|
||||
rv = sBundleService->CreateBundle(MESSENGER_STRING_URL, getter_AddRefs(sMessengerStringBundle));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -2120,7 +2079,7 @@ nsresult nsMsgFolderDataSource::DoDeleteFromFolder(
|
|||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
PRBool dialogResult;
|
||||
rv = dialog->Confirm(nsnull, confirmMsg, &dialogResult);
|
||||
rv = dialog->Confirm(nsnull, confirmMsg.get(), &dialogResult);
|
||||
if (!dialogResult)
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2137,11 +2096,9 @@ nsresult nsMsgFolderDataSource::DoNewFolder(nsIMsgFolder *folder, nsISupportsArr
|
|||
nsCOMPtr<nsIRDFLiteral> literal = do_QueryElementAt(arguments, 0, &rv);
|
||||
if(NS_SUCCEEDED(rv))
|
||||
{
|
||||
nsXPIDLString name;
|
||||
nsString name;
|
||||
literal->GetValue(getter_Copies(name));
|
||||
|
||||
rv = folder->CreateSubfolder(name, window);
|
||||
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "nsIMsgMessageService.h"
|
||||
#include "nsMsgUtils.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIMsgAccountManager.h"
|
||||
#include "nsIChromeRegistry.h"
|
||||
#include "nsIDirectoryService.h"
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
#include "nsNetCID.h"
|
||||
#include "nsMsgNewsCID.h"
|
||||
#include "nsINntpService.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
static NS_DEFINE_CID(kMsgSendLaterCID, NS_MSGSENDLATER_CID);
|
||||
|
||||
|
@ -284,11 +283,11 @@ nsresult nsMsgOfflineManager::ShowStatus(const char *statusMsgName)
|
|||
}
|
||||
if (mStringBundle)
|
||||
{
|
||||
nsXPIDLString statusString;
|
||||
res = mStringBundle->GetStringFromName(NS_ConvertASCIItoUTF16(statusMsgName).get(), getter_Copies(statusString));
|
||||
nsString statusString;
|
||||
res = mStringBundle->GetStringFromName(NS_ConvertASCIItoUTF16(statusMsgName).get(), getter_Copies(statusString));
|
||||
|
||||
if ( NS_SUCCEEDED(res))
|
||||
OnStatus(statusString);
|
||||
OnStatus(statusString.get());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
#include "nsIURI.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
|
|
|
@ -296,7 +296,7 @@ nsresult nsMsgPurgeService::PerformPurge()
|
|||
|
||||
// check if the spam folder uri is set for this server
|
||||
// if not skip it.
|
||||
nsXPIDLCString junkFolderURI;
|
||||
nsCString junkFolderURI;
|
||||
rv = spamSettings->GetSpamFolderURI(getter_Copies(junkFolderURI));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
@ -468,9 +468,9 @@ NS_IMETHODIMP nsMsgPurgeService::OnSearchHit(nsIMsgDBHdr* aMsgHdr, nsIMsgFolder
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aMsgHdr);
|
||||
|
||||
nsXPIDLCString messageId;
|
||||
nsXPIDLCString author;
|
||||
nsXPIDLCString subject;
|
||||
nsCString messageId;
|
||||
nsCString author;
|
||||
nsCString subject;
|
||||
|
||||
aMsgHdr->GetMessageId(getter_Copies(messageId));
|
||||
PR_LOG(MsgPurgeLogModule, PR_LOG_ALWAYS, ("messageId=%s", messageId.get()));
|
||||
|
@ -488,7 +488,7 @@ NS_IMETHODIMP nsMsgPurgeService::OnSearchHit(nsIMsgDBHdr* aMsgHdr, nsIMsgFolder
|
|||
// so the junk status would be in the message db.
|
||||
//
|
||||
// see bug #194090
|
||||
nsXPIDLCString junkScoreStr;
|
||||
nsCString junkScoreStr;
|
||||
nsresult rv = aMsgHdr->GetStringProperty("junkscore", getter_Copies(junkScoreStr));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "nsRDFCID.h"
|
||||
#include "rdf.h"
|
||||
#include "plstr.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsMsgRDFUtils.h"
|
||||
#include "nsEnumeratorUtils.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
|
|
@ -39,8 +39,6 @@
|
|||
#include "nsMsgServiceProvider.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
#include "nsRDFCID.h"
|
||||
#include "nsIRDFService.h"
|
||||
#include "nsIRDFRemoteDataSource.h"
|
||||
|
|
|
@ -37,8 +37,6 @@
|
|||
|
||||
#include "msgCore.h"
|
||||
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
#include "nsIWebProgress.h"
|
||||
#include "nsIXULBrowserWindow.h"
|
||||
#include "nsMsgStatusFeedback.h"
|
||||
|
@ -131,11 +129,11 @@ nsMsgStatusFeedback::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
NS_TIMELINE_ENTER("Start Msg Loading in progress");
|
||||
m_lastPercent = 0;
|
||||
StartMeteors();
|
||||
nsXPIDLString loadingDocument;
|
||||
nsString loadingDocument;
|
||||
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("documentLoading").get(),
|
||||
getter_Copies(loadingDocument));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
ShowStatusString(loadingDocument);
|
||||
ShowStatusString(loadingDocument.get());
|
||||
}
|
||||
else if (aProgressStateFlags & STATE_STOP)
|
||||
{
|
||||
|
@ -175,7 +173,6 @@ nsMsgStatusFeedback::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
// using NotifyPropertyFlagChanged. To be completely consistent,
|
||||
// we'd send a similar notification that the old message was
|
||||
// unloaded.
|
||||
nsXPIDLCString spec;
|
||||
nsCOMPtr <nsIMsgDBHdr> msgHdr;
|
||||
nsCOMPtr <nsIMsgFolder> msgFolder;
|
||||
mailnewsUrl->GetFolder(getter_AddRefs(msgFolder));
|
||||
|
@ -191,11 +188,11 @@ nsMsgStatusFeedback::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
}
|
||||
}
|
||||
StopMeteors();
|
||||
nsXPIDLString documentDone;
|
||||
nsString documentDone;
|
||||
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("documentDone").get(),
|
||||
getter_Copies(documentDone));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
ShowStatusString(documentDone);
|
||||
ShowStatusString(documentDone.get());
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -317,10 +314,9 @@ NS_IMETHODIMP nsMsgStatusFeedback::OnStatus(nsIRequest *request, nsISupports* ct
|
|||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIStringBundleService> sbs = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsXPIDLString str;
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsString str;
|
||||
rv = sbs->FormatStatusMessage(aStatus, aStatusArg, getter_Copies(str));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsAutoString msg(NS_STATIC_CAST(const PRUnichar*, str));
|
||||
return ShowStatusString(msg.get());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return ShowStatusString(str.get());
|
||||
}
|
||||
|
|
|
@ -304,7 +304,7 @@ NS_IMETHODIMP nsMsgTagService::GetColorForKey(const nsACString &key, nsACString
|
|||
if (!gMigratingKeys)
|
||||
ToLowerCase(prefName);
|
||||
prefName.AppendLiteral(TAG_PREF_SUFFIX_COLOR);
|
||||
nsXPIDLCString color;
|
||||
nsCString color;
|
||||
nsresult rv = m_tagPrefBranch->GetCharPref(prefName.get(), getter_Copies(color));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
_retval = color;
|
||||
|
@ -322,7 +322,7 @@ NS_IMETHODIMP nsMsgTagService::SetColorForKey(const nsACString & key, const nsAC
|
|||
m_tagPrefBranch->ClearUserPref(prefName.get());
|
||||
return NS_OK;
|
||||
}
|
||||
return m_tagPrefBranch->SetCharPref(prefName.get(), PromiseFlatCString(color).get());
|
||||
return m_tagPrefBranch->SetCharPref(prefName.get(), nsCString(color).get());
|
||||
}
|
||||
|
||||
/* ACString getOrdinalForKey (in ACString key); */
|
||||
|
@ -332,7 +332,7 @@ NS_IMETHODIMP nsMsgTagService::GetOrdinalForKey(const nsACString & key, nsACStri
|
|||
if (!gMigratingKeys)
|
||||
ToLowerCase(prefName);
|
||||
prefName.AppendLiteral(TAG_PREF_SUFFIX_ORDINAL);
|
||||
nsXPIDLCString ordinal;
|
||||
nsCString ordinal;
|
||||
nsresult rv = m_tagPrefBranch->GetCharPref(prefName.get(), getter_Copies(ordinal));
|
||||
_retval = ordinal;
|
||||
return rv;
|
||||
|
@ -349,7 +349,7 @@ NS_IMETHODIMP nsMsgTagService::SetOrdinalForKey(const nsACString & key, const ns
|
|||
m_tagPrefBranch->ClearUserPref(prefName.get());
|
||||
return NS_OK;
|
||||
}
|
||||
return m_tagPrefBranch->SetCharPref(prefName.get(), PromiseFlatCString(ordinal).get());
|
||||
return m_tagPrefBranch->SetCharPref(prefName.get(), nsCString(ordinal).get());
|
||||
}
|
||||
|
||||
/* void deleteTag (in wstring tag); */
|
||||
|
@ -510,7 +510,7 @@ nsresult nsMsgTagService::MigrateLabelsToTags()
|
|||
{
|
||||
nsCOMPtr<nsIPrefBranch> prefRoot(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
nsCOMPtr<nsIPrefLocalizedString> pls;
|
||||
nsXPIDLString ucsval;
|
||||
nsString ucsval;
|
||||
nsCAutoString labelKey("$label1");
|
||||
for(PRInt32 i = 0; i < PREF_LABELS_MAX; )
|
||||
{
|
||||
|
@ -524,7 +524,7 @@ nsresult nsMsgTagService::MigrateLabelsToTags()
|
|||
|
||||
prefString.Assign(PREF_LABELS_COLOR);
|
||||
prefString.AppendInt(i + 1);
|
||||
nsXPIDLCString csval;
|
||||
nsCString csval;
|
||||
rv = prefRoot->GetCharPref(prefString.get(), getter_Copies(csval));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsIRDFService.h"
|
||||
#include "nsRDFCID.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "rdf.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsEnumeratorUtils.h"
|
||||
|
@ -141,22 +140,21 @@ nsSoundDatasource::GetTarget(nsIRDFResource *source,
|
|||
if (!tv)
|
||||
return NS_RDF_NO_VALUE;
|
||||
|
||||
nsXPIDLCString value;
|
||||
nsCString value;
|
||||
rv = source->GetValue(getter_Copies(value));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (property == kNC_Name.get()) {
|
||||
nsCOMPtr<nsIRDFLiteral> name;
|
||||
if (strcmp(value.get(), DEFAULT_SOUND_URL)) {
|
||||
if (!value.Equals(DEFAULT_SOUND_URL)) {
|
||||
const char *lastSlash = strrchr(value.get(), '/');
|
||||
// turn "file://C|/winnt/media/foo.wav" into "foo".
|
||||
nsCAutoString soundName(lastSlash + 1);
|
||||
soundName.Truncate(soundName.Length() - WAV_EXTENSION_LENGTH);
|
||||
soundName.SetLength(soundName.Length() - WAV_EXTENSION_LENGTH);
|
||||
rv = mRDFService->GetLiteral(NS_ConvertASCIItoUTF16(soundName).get(), getter_AddRefs(name));
|
||||
}
|
||||
else {
|
||||
else
|
||||
rv = mRDFService->GetLiteral(NS_ConvertASCIItoUTF16(DEFAULT_SOUND_URL_NAME).get(), getter_AddRefs(name));
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (!name)
|
||||
|
@ -230,12 +228,12 @@ nsSoundDatasource::GetTargets(nsIRDFResource *source,
|
|||
if (!tv)
|
||||
return NS_RDF_NO_VALUE;
|
||||
|
||||
nsXPIDLCString value;
|
||||
nsCString value;
|
||||
rv = source->GetValue(getter_Copies(value));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (property == kNC_Child.get()) {
|
||||
if (strcmp(value.get(), SOUND_ROOT))
|
||||
if (!value.Equals(SOUND_ROOT))
|
||||
return NS_NewEmptyEnumerator(targets);
|
||||
|
||||
nsCOMPtr<nsISupportsArray> children;
|
||||
|
@ -290,7 +288,7 @@ nsSoundDatasource::GetTargets(nsIRDFResource *source,
|
|||
rv = theFileURL->SetFile(theFile);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsXPIDLCString theFileSpec;
|
||||
nsCString theFileSpec;
|
||||
rv = theFileURL->GetSpec(theFileSpec);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
@ -314,11 +312,10 @@ nsSoundDatasource::GetTargets(nsIRDFResource *source,
|
|||
nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsXPIDLCString soundURLSpec;
|
||||
rv = prefBranch->GetCharPref(PREF_NEW_MAIL_URL,getter_Copies(soundURLSpec));
|
||||
nsCString soundURLSpec;
|
||||
rv = prefBranch->GetCharPref(PREF_NEW_MAIL_URL, getter_Copies(soundURLSpec));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (!strncmp(soundURLSpec.get(), FILE_SCHEME, FILE_SCHEME_LEN)) {
|
||||
if (soundURLSpec.StringBeginsWith(FILE_SCHEME)) {
|
||||
rv = mRDFService->GetResource(soundURLSpec, getter_AddRefs(res));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = children->AppendElement(res);
|
||||
|
@ -350,7 +347,7 @@ nsSoundDatasource::GetTargets(nsIRDFResource *source,
|
|||
const char *lastSlash = strrchr(value.get(), '/');
|
||||
// turn "file://C|/winnt/media/foo.wav" into "foo".
|
||||
nsCAutoString soundName(lastSlash + 1);
|
||||
soundName.Truncate(soundName.Length() - WAV_EXTENSION_LENGTH);
|
||||
soundName.SetLength(soundName.Length() - WAV_EXTENSION_LENGTH);
|
||||
rv = mRDFService->GetLiteral(NS_ConvertASCIItoUTF16(soundName).get(), getter_AddRefs(name));
|
||||
}
|
||||
else {
|
||||
|
@ -427,11 +424,11 @@ nsSoundDatasource::HasAssertion(nsIRDFResource *source,
|
|||
return NS_OK;
|
||||
|
||||
if (property == kNC_Child.get()) {
|
||||
nsXPIDLCString value;
|
||||
nsCString value;
|
||||
nsresult rv = source->GetValue(getter_Copies(value));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
// only root has children
|
||||
*hasAssertion = (strcmp(value.get(), SOUND_ROOT) == 0);
|
||||
*hasAssertion = value.Equals(SOUND_ROOT);
|
||||
return NS_OK;
|
||||
}
|
||||
else if (property == kNC_Name.get() || property == kNC_SoundURL.get()) {
|
||||
|
@ -458,7 +455,7 @@ nsSoundDatasource::HasArcOut(nsIRDFResource *source, nsIRDFResource *aArc, PRBoo
|
|||
nsresult rv = NS_OK;
|
||||
|
||||
if (aArc == kNC_Child.get()) {
|
||||
nsXPIDLCString value;
|
||||
nsCString value;
|
||||
rv = source->GetValue(getter_Copies(value));
|
||||
// only root has children
|
||||
*result = (strcmp(value.get(), SOUND_ROOT) == 0);
|
||||
|
@ -498,14 +495,13 @@ nsSoundDatasource::ArcLabelsOut(nsIRDFResource *source,
|
|||
array->AppendElement(kNC_Name);
|
||||
array->AppendElement(kNC_SoundURL);
|
||||
|
||||
nsXPIDLCString value;
|
||||
nsCString value;
|
||||
rv = source->GetValue(getter_Copies(value));
|
||||
// only root has children
|
||||
PRBool hasChildren = (strcmp(value.get(), SOUND_ROOT) == 0);
|
||||
PRBool hasChildren = value.Equals(SOUND_ROOT);
|
||||
|
||||
if (hasChildren) {
|
||||
if (hasChildren)
|
||||
array->AppendElement(kNC_Child);
|
||||
}
|
||||
|
||||
nsISimpleEnumerator* result = new nsArrayEnumerator(array);
|
||||
if (!result)
|
||||
|
|
|
@ -351,7 +351,7 @@ nsresult nsSpamSettings::UpdateJunkFolderState()
|
|||
|
||||
// if the spam folder uri changed on us, we need to unset the junk flag
|
||||
// on the old spam folder
|
||||
nsXPIDLCString newJunkFolderURI;
|
||||
nsCString newJunkFolderURI;
|
||||
rv = GetSpamFolderURI(getter_Copies(newJunkFolderURI));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -404,17 +404,17 @@ NS_IMETHODIMP nsSpamSettings::Clone(nsISpamSettings *aSpamSettings)
|
|||
rv = aSpamSettings->GetMoveTargetMode(&mMoveTargetMode);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsXPIDLCString actionTargetAccount;
|
||||
nsCString actionTargetAccount;
|
||||
rv = aSpamSettings->GetActionTargetAccount(getter_Copies(actionTargetAccount));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
mActionTargetAccount = actionTargetAccount;
|
||||
|
||||
nsXPIDLCString actionTargetFolder;
|
||||
nsCString actionTargetFolder;
|
||||
rv = aSpamSettings->GetActionTargetFolder(getter_Copies(actionTargetFolder));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
mActionTargetFolder = actionTargetFolder;
|
||||
|
||||
nsXPIDLCString whiteListAbURI;
|
||||
nsCString whiteListAbURI;
|
||||
rv = aSpamSettings->GetWhiteListAbURI(getter_Copies(whiteListAbURI));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
mWhiteListAbURI = whiteListAbURI;
|
||||
|
@ -434,7 +434,7 @@ NS_IMETHODIMP nsSpamSettings::GetSpamFolderURI(char **aSpamFolderURI)
|
|||
|
||||
// if the mode is nsISpamSettings::MOVE_TARGET_MODE_ACCOUNT
|
||||
// the spam folder URI = account uri + "/Junk"
|
||||
nsXPIDLCString folderURI;
|
||||
nsCString folderURI;
|
||||
nsresult rv = GetActionTargetAccount(getter_Copies(folderURI));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
@ -561,9 +561,9 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit(nsIMsgDBHdr *aMsgHdr, PRBool aMoveMessa
|
|||
|
||||
PRTime date;
|
||||
|
||||
nsXPIDLString authorValue;
|
||||
nsXPIDLString subjectValue;
|
||||
nsXPIDLString dateValue;
|
||||
nsString authorValue;
|
||||
nsString subjectValue;
|
||||
nsString dateValue;
|
||||
|
||||
(void)aMsgHdr->GetDate(&date);
|
||||
PRExplodedTime exploded;
|
||||
|
@ -600,7 +600,7 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit(nsIMsgDBHdr *aMsgHdr, PRBool aMoveMessa
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
const PRUnichar *junkLogDetectFormatStrings[3] = { authorValue.get(), subjectValue.get(), dateValue.get() };
|
||||
nsXPIDLString junkLogDetectStr;
|
||||
nsString junkLogDetectStr;
|
||||
rv = bundle->FormatStringFromName(
|
||||
NS_LITERAL_STRING("junkLogDetectStr").get(),
|
||||
junkLogDetectFormatStrings, 3,
|
||||
|
@ -611,10 +611,10 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit(nsIMsgDBHdr *aMsgHdr, PRBool aMoveMessa
|
|||
buffer += "\n";
|
||||
|
||||
if (aMoveMessage) {
|
||||
nsXPIDLCString msgId;
|
||||
nsCString msgId;
|
||||
aMsgHdr->GetMessageId(getter_Copies(msgId));
|
||||
|
||||
nsXPIDLCString junkFolderURI;
|
||||
nsCString junkFolderURI;
|
||||
rv = GetSpamFolderURI(getter_Copies(junkFolderURI));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -622,7 +622,7 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit(nsIMsgDBHdr *aMsgHdr, PRBool aMoveMessa
|
|||
NS_ConvertASCIItoUTF16 junkFolderURIValue(junkFolderURI);
|
||||
|
||||
const PRUnichar *logMoveFormatStrings[2] = { msgIdValue.get(), junkFolderURIValue.get() };
|
||||
nsXPIDLString logMoveStr;
|
||||
nsString logMoveStr;
|
||||
rv = bundle->FormatStringFromName(
|
||||
NS_LITERAL_STRING("logMoveStr").get(),
|
||||
logMoveFormatStrings, 2,
|
||||
|
@ -683,7 +683,7 @@ NS_IMETHODIMP nsSpamSettings::OnStartRunningUrl(nsIURI* aURL)
|
|||
|
||||
NS_IMETHODIMP nsSpamSettings::OnStopRunningUrl(nsIURI* aURL, nsresult exitCode)
|
||||
{
|
||||
nsXPIDLCString junkFolderURI;
|
||||
nsCString junkFolderURI;
|
||||
nsresult rv = GetSpamFolderURI(getter_Copies(junkFolderURI));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "nsIFileChannel.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIFileURL.h"
|
||||
|
@ -125,7 +124,7 @@ nsresult nsStatusBarBiffManager::PlayBiffSound()
|
|||
PRBool customSoundPlayed = PR_FALSE;
|
||||
|
||||
if (newMailSoundType == CUSTOM_SOUND_TYPE) {
|
||||
nsXPIDLCString soundURLSpec;
|
||||
nsCString soundURLSpec;
|
||||
rv = pref->GetCharPref(PREF_NEW_MAIL_SOUND_URL, getter_Copies(soundURLSpec));
|
||||
if (NS_SUCCEEDED(rv) && !soundURLSpec.IsEmpty()) {
|
||||
if (!strncmp(soundURLSpec.get(), "file://", 7)) {
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsCOMPtr.h"
|
||||
|
||||
#include "nsCRT.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "prmem.h"
|
||||
|
||||
|
@ -632,7 +631,7 @@ nsSubscribableServer::FindAndCreateNode(const nsACString &aPath,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
char *pathStr = nsCRT::strdup(PromiseFlatCString(aPath).get());
|
||||
char *pathStr = ToNewCString(aPath);
|
||||
char *token = nsnull;
|
||||
char *rest = pathStr;
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsIRDFService.h"
|
||||
#include "nsRDFCID.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "rdf.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsEnumeratorUtils.h"
|
||||
|
@ -169,12 +168,10 @@ nsSubscribeDataSource::GetTarget(nsIRDFResource *source,
|
|||
if (! tv) return NS_RDF_NO_VALUE;
|
||||
|
||||
nsCOMPtr<nsISubscribableServer> server;
|
||||
nsXPIDLCString relativePath;
|
||||
|
||||
nsCString relativePath;
|
||||
rv = GetServerAndRelativePathFromResource(source, getter_AddRefs(server), getter_Copies(relativePath));
|
||||
if (NS_FAILED(rv) || !server) {
|
||||
if (NS_FAILED(rv) || !server)
|
||||
return NS_RDF_NO_VALUE;
|
||||
}
|
||||
|
||||
if (property == kNC_Name.get()) {
|
||||
nsCOMPtr<nsIRDFLiteral> name;
|
||||
|
@ -187,7 +184,7 @@ nsSubscribeDataSource::GetTarget(nsIRDFResource *source,
|
|||
return name->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);
|
||||
}
|
||||
else if (property == kNC_Child.get()) {
|
||||
nsXPIDLCString childUri;
|
||||
nsCString childUri;
|
||||
rv = server->GetFirstChildURI(relativePath, childUri);
|
||||
if (NS_FAILED(rv)) return NS_RDF_NO_VALUE;
|
||||
if (childUri.IsEmpty()) return NS_RDF_NO_VALUE;
|
||||
|
@ -231,12 +228,12 @@ nsSubscribeDataSource::GetTarget(nsIRDFResource *source,
|
|||
return serverType->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);
|
||||
}
|
||||
else if (property == kNC_LeafName.get()) {
|
||||
nsXPIDLString leafNameStr;
|
||||
nsString leafNameStr;
|
||||
rv = server->GetLeafName(relativePath, leafNameStr);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsCOMPtr<nsIRDFLiteral> leafName;
|
||||
rv = mRDFService->GetLiteral(leafNameStr, getter_AddRefs(leafName));
|
||||
rv = mRDFService->GetLiteral(leafNameStr.get(), getter_AddRefs(leafName));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (!leafName)
|
||||
|
@ -299,7 +296,7 @@ nsSubscribeDataSource::GetTargets(nsIRDFResource *source,
|
|||
if (!tv) return NS_RDF_NO_VALUE;
|
||||
|
||||
nsCOMPtr<nsISubscribableServer> server;
|
||||
nsXPIDLCString relativePath; // UTF-8
|
||||
nsCString relativePath; // UTF-8
|
||||
|
||||
rv = GetServerAndRelativePathFromResource(source, getter_AddRefs(server), getter_Copies(relativePath));
|
||||
if (NS_FAILED(rv) || !server) {
|
||||
|
@ -314,12 +311,12 @@ nsSubscribeDataSource::GetTargets(nsIRDFResource *source,
|
|||
return rv;
|
||||
}
|
||||
else if (property == kNC_LeafName.get()) {
|
||||
nsXPIDLString leafNameStr;
|
||||
nsString leafNameStr;
|
||||
rv = server->GetLeafName(relativePath, leafNameStr);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsCOMPtr<nsIRDFLiteral> leafName;
|
||||
rv = mRDFService->GetLiteral(leafNameStr, getter_AddRefs(leafName));
|
||||
rv = mRDFService->GetLiteral(leafNameStr.get(), getter_AddRefs(leafName));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
return NS_NewSingletonEnumerator(targets, leafName);
|
||||
|
@ -488,7 +485,7 @@ nsSubscribeDataSource::HasAssertion(nsIRDFResource *source,
|
|||
|
||||
if (property == kNC_Child.get()) {
|
||||
nsCOMPtr<nsISubscribableServer> server;
|
||||
nsXPIDLCString relativePath;
|
||||
nsCString relativePath;
|
||||
|
||||
rv = GetServerAndRelativePathFromResource(source, getter_AddRefs(server), getter_Copies(relativePath));
|
||||
if (NS_FAILED(rv) || !server) {
|
||||
|
@ -540,7 +537,7 @@ nsSubscribeDataSource::HasArcOut(nsIRDFResource *source, nsIRDFResource *aArc, P
|
|||
nsresult rv = NS_OK;
|
||||
|
||||
nsCOMPtr<nsISubscribableServer> server;
|
||||
nsXPIDLCString relativePath;
|
||||
nsCString relativePath;
|
||||
|
||||
if (aArc == kNC_Child.get()) {
|
||||
rv = GetServerAndRelativePathFromResource(source, getter_AddRefs(server), getter_Copies(relativePath));
|
||||
|
@ -593,7 +590,7 @@ nsSubscribeDataSource::ArcLabelsOut(nsIRDFResource *source,
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsCOMPtr<nsISubscribableServer> server;
|
||||
nsXPIDLCString relativePath;
|
||||
nsCString relativePath;
|
||||
|
||||
rv = GetServerAndRelativePathFromResource(source, getter_AddRefs(server), getter_Copies(relativePath));
|
||||
if (NS_FAILED(rv) || !server) {
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#include "nsIMsgMailNewsUrl.h"
|
||||
#include "nsMsgDatabase.h"
|
||||
#include "nsIMsgAccountManager.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsISeekableStream.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
|
@ -351,7 +350,7 @@ NS_IMETHODIMP nsMsgDBFolder::SetCharset(const nsACString& aCharset)
|
|||
rv = GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db));
|
||||
if(NS_SUCCEEDED(rv))
|
||||
{
|
||||
rv = folderInfo->SetCharacterSet(nsPromiseFlatCString(aCharset).get());
|
||||
rv = folderInfo->SetCharacterSet(nsCString(aCharset).get());
|
||||
db->Commit(nsMsgDBCommitType::kLargeCommit);
|
||||
mCharset = aCharset;
|
||||
}
|
||||
|
@ -753,7 +752,7 @@ nsresult nsMsgDBFolder::CreateFileForDB(const nsACString& userLeafName, nsILocal
|
|||
dbPath->GetNativeLeafName(proposedDBName);
|
||||
}
|
||||
// now, take the ".msf" off
|
||||
proposedDBName.Truncate(proposedDBName.Length() - NS_LITERAL_CSTRING(SUMMARY_SUFFIX).Length());
|
||||
proposedDBName.SetLength(proposedDBName.Length() - NS_LITERAL_CSTRING(SUMMARY_SUFFIX).Length());
|
||||
dbPath->SetNativeLeafName(proposedDBName);
|
||||
|
||||
dbPath.swap(*dbFile);
|
||||
|
@ -1776,7 +1775,7 @@ nsMsgDBFolder::SetStringProperty(const char *propertyName, const nsACString& pro
|
|||
nsresult rv = GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db));
|
||||
if(NS_SUCCEEDED(rv))
|
||||
{
|
||||
folderInfo->SetCharPtrProperty(propertyName, nsPromiseFlatCString(propertyValue).get());
|
||||
folderInfo->SetCharPtrProperty(propertyName, nsCString(propertyValue).get());
|
||||
db->Commit(nsMsgDBCommitType::kLargeCommit); //commiting the db also commits the cache
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1934,8 +1933,8 @@ nsMsgDBFolder::CallFilterPlugins(nsIMsgWindow *aMsgWindow, PRBool *aFiltersRun)
|
|||
rv = mDatabase->GetMsgHdrForKey(msgKey, getter_AddRefs(msgHdr));
|
||||
if (!NS_SUCCEEDED(rv))
|
||||
continue;
|
||||
nsXPIDLCString author;
|
||||
nsXPIDLCString authorEmailAddress;
|
||||
nsCString author;
|
||||
nsCString authorEmailAddress;
|
||||
if (whiteListDirArray.Count() != 0 || !trustedMailDomains.IsEmpty())
|
||||
{
|
||||
msgHdr->GetAuthor(getter_Copies(author));
|
||||
|
@ -1969,7 +1968,7 @@ nsMsgDBFolder::CallFilterPlugins(nsIMsgWindow *aMsgWindow, PRBool *aFiltersRun)
|
|||
if (!authorEmailAddress.IsEmpty())
|
||||
{
|
||||
for (PRInt32 index = 0; index < whiteListDirArray.Count() && !cardExists; index++)
|
||||
rv = whiteListDirArray[index]->HasCardForEmailAddress(authorEmailAddress, &cardExists);
|
||||
rv = whiteListDirArray[index]->HasCardForEmailAddress(authorEmailAddress.get(), &cardExists);
|
||||
if (NS_FAILED(rv))
|
||||
cardExists = PR_FALSE;
|
||||
}
|
||||
|
@ -4534,7 +4533,7 @@ nsMsgDBFolder::ThrowConfirmationPrompt(nsIMsgWindow *msgWindow, const nsAString&
|
|||
{
|
||||
nsCOMPtr<nsIPrompt> dialog(do_GetInterface(docShell));
|
||||
if (dialog && !confirmString.IsEmpty())
|
||||
dialog->Confirm(nsnull, nsPromiseFlatString(confirmString).get(), confirmed);
|
||||
dialog->Confirm(nsnull, nsString(confirmString).get(), confirmed);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -4901,9 +4900,9 @@ NS_IMETHODIMP nsMsgDBFolder::GetMsgTextFromStream(nsIMsgDBHdr *msgHdr, nsIInputS
|
|||
// finally, truncate the string based on aMaxOutputLen
|
||||
if (aMsgText.Length() > aMaxOutputLen) {
|
||||
if (IsASCII(aMsgText))
|
||||
aMsgText.Truncate(aMaxOutputLen);
|
||||
aMsgText.SetLength(aMaxOutputLen);
|
||||
else
|
||||
nsMsgI18NShrinkUTF8Str(nsPromiseFlatCString(aMsgText),
|
||||
nsMsgI18NShrinkUTF8Str(nsCString(aMsgText),
|
||||
aMaxOutputLen, aMsgText);
|
||||
}
|
||||
return rv;
|
||||
|
@ -4938,7 +4937,7 @@ void nsMsgDBFolder::decodeMsgSnippet(const nsACString& aEncodingType, PRBool aIs
|
|||
{
|
||||
// giant hack - decode in place, and truncate string.
|
||||
MsgStripQuotedPrintable((unsigned char *) aMsgSnippet.get());
|
||||
aMsgSnippet.Truncate(strlen(aMsgSnippet.get()));
|
||||
aMsgSnippet.SetLength(strlen(aMsgSnippet.get()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5064,7 +5063,7 @@ NS_IMETHODIMP nsMsgDBFolder::AddKeywordsToMessages(nsISupportsArray *aMessages,
|
|||
|
||||
message->GetStringProperty("keywords", getter_Copies(keywords));
|
||||
nsCStringArray keywordArray;
|
||||
keywordArray.ParseString(nsPromiseFlatCString(aKeywords).get(), " ");
|
||||
keywordArray.ParseString(nsCString(aKeywords).get(), " ");
|
||||
for (PRInt32 j = 0; j < keywordArray.Count(); j++)
|
||||
{
|
||||
nsACString::const_iterator start, end;
|
||||
|
@ -5108,7 +5107,7 @@ NS_IMETHODIMP nsMsgDBFolder::RemoveKeywordsFromMessages(nsISupportsArray *aMessa
|
|||
(void) message->GetMessageKey(&msgKey);
|
||||
rv = message->GetStringProperty("keywords", getter_Copies(keywords));
|
||||
nsCStringArray keywordArray;
|
||||
keywordArray.ParseString(nsPromiseFlatCString(aKeywords).get(), " ");
|
||||
keywordArray.ParseString(nsCString(aKeywords).get(), " ");
|
||||
for (PRInt32 j = 0; j < keywordArray.Count(); j++)
|
||||
{
|
||||
PRBool keywordIsLabel = (StringBeginsWith(*(keywordArray[j]), NS_LITERAL_CSTRING("$label"))
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
#include "nsIEntityConverter.h"
|
||||
#include "nsISaveAsCharset.h"
|
||||
#include "nsHankakuToZenkakuCID.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "prmem.h"
|
||||
|
@ -323,7 +322,7 @@ PRBool nsMsgI18Ncheck_data_in_charset_range(const char *charset, const PRUnichar
|
|||
|
||||
// if the conversion was not successful then try fallback to other charsets
|
||||
if (!result && fallbackCharset) {
|
||||
nsXPIDLCString convertedString;
|
||||
nsCString convertedString;
|
||||
res = nsMsgI18NSaveAsCharset("text/plain", charset, inString,
|
||||
getter_Copies(convertedString), fallbackCharset);
|
||||
result = (NS_SUCCEEDED(res) && NS_ERROR_UENC_NOMAPPING != res);
|
||||
|
@ -510,7 +509,7 @@ nsresult nsMsgI18NSaveAsCharset(const char* contentType, const char *charset,
|
|||
|
||||
nsCAutoString prefString("intl.fallbackCharsetList.");
|
||||
prefString.Append(charset);
|
||||
nsXPIDLCString fallbackList;
|
||||
nsCString fallbackList;
|
||||
res = prefBranch->GetCharPref(prefString.get(), getter_Copies(fallbackList));
|
||||
// do the fallback only if there is a pref for the charset
|
||||
if (NS_FAILED(res) || fallbackList.IsEmpty())
|
||||
|
@ -546,6 +545,7 @@ nsresult nsMsgI18NFormatNNTPXPATInNonRFC1522Format(const nsCString& aCharset,
|
|||
const nsString& inString,
|
||||
nsCString& outString)
|
||||
{
|
||||
LossyCopyUTF16toASCII(inString, outString);
|
||||
outString.AssignWithConversion(inString);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ nsMsgI18NGetAcceptLanguage(void)
|
|||
getter_AddRefs(prefString));
|
||||
if (prefString)
|
||||
{
|
||||
nsXPIDLString ucsval;
|
||||
nsString ucsval;
|
||||
prefString->ToString(getter_Copies(ucsval));
|
||||
if (!ucsval.IsEmpty())
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ NS_MSG_BASE PRBool nsMsgI18Nmultibyte_charset(const char *charset);
|
|||
* @param fallbackCharset [OUT]
|
||||
* null if fallback charset is not needed.
|
||||
* Otherwise, a fallback charset name may be set if that was used for the conversion.
|
||||
* Caller is responsible for freeing the memory (or use nsXPIDLCString).
|
||||
* Caller is responsible for freeing the memory.
|
||||
* @return True if the string can be converted within the charset range.
|
||||
* False if one or more characters cannot be converted to the target charset.
|
||||
*/
|
||||
|
@ -165,7 +165,7 @@ NS_MSG_BASE nsresult nsMsgI18NConvertToEntity(const nsString& inString, nsString
|
|||
* @param fallbackCharset [OUT]
|
||||
* null if fallback charset is not needed.
|
||||
* Otherwise, a fallback charset name may be set if that was used for the conversion.
|
||||
* Caller is responsible for freeing the memory (or use nsXPIDLCString).
|
||||
* Caller is responsible for freeing the memory.
|
||||
* @param isAsciiOnly [OUT]
|
||||
* null if non ASCII info is not needed.
|
||||
* Otherwise, true is set if the input data is ASCII only false otherwise.
|
||||
|
|
|
@ -740,7 +740,7 @@ nsMsgIncomingServer::GetPasswordWithUI(const nsAString& aPromptMessage, const
|
|||
uniPassword = ToNewUnicode(NS_ConvertASCIItoUTF16(aPassword));
|
||||
|
||||
PRUint32 savePasswordType = PasswordProtectLocalCache() ? nsIAuthPrompt::SAVE_PASSWORD_FOR_SESSION : nsIAuthPrompt::SAVE_PASSWORD_PERMANENTLY;
|
||||
rv = dialog->PromptPassword(PromiseFlatString(aPromptTitle).get(), PromiseFlatString(aPromptMessage).get(),
|
||||
rv = dialog->PromptPassword(nsString(aPromptTitle).get(), nsString(aPromptMessage).get(),
|
||||
NS_ConvertASCIItoUTF16(serverUri).get(), savePasswordType,
|
||||
&uniPassword, okayValue);
|
||||
nsAutoString uniPasswordAdopted;
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "nsMsgBaseCID.h"
|
||||
#include "nsIMsgMailSession.h"
|
||||
#include "nsIMsgAccountManager.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsIStreamTransportService.h"
|
||||
#include "nsISocketTransportService.h"
|
||||
#include "nsISocketTransport.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsILoadGroup.h"
|
||||
#include "nsIIOService.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -785,7 +784,7 @@ nsresult nsMsgProtocol::PostMessage(nsIURI* url, nsIFile *postFile)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool more = PR_TRUE;
|
||||
nsXPIDLCString line;
|
||||
nsCString line;
|
||||
nsCString outputBuffer;
|
||||
|
||||
do
|
||||
|
|
|
@ -427,7 +427,7 @@ nsresult NS_MsgHashIfNecessary(nsAutoString &name)
|
|||
|
||||
if (keptLength >= 0) {
|
||||
PR_snprintf(hashedname, 9, "%08lx", (unsigned long) StringHash(name));
|
||||
name.Truncate(keptLength);
|
||||
name.SetLength(keptLength);
|
||||
AppendASCIItoUTF16(hashedname, name);
|
||||
}
|
||||
|
||||
|
@ -513,7 +513,7 @@ PRBool NS_MsgStripRE(const char **stringP, PRUint32 *lengthP, char **modifiedSub
|
|||
|
||||
// get localizedRe pref
|
||||
nsresult rv;
|
||||
nsXPIDLCString localizedRe;
|
||||
nsCString localizedRe;
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
prefBranch->GetCharPref("mailnews.localizedRe", getter_Copies(localizedRe));
|
||||
|
@ -524,7 +524,7 @@ PRBool NS_MsgStripRE(const char **stringP, PRUint32 *lengthP, char **modifiedSub
|
|||
checkString.Append(NS_LITERAL_CSTRING(",") + localizedRe);
|
||||
|
||||
// decode the string
|
||||
nsXPIDLCString decodedString;
|
||||
nsCString decodedString;
|
||||
nsCOMPtr<nsIMimeConverter> mimeConverter;
|
||||
// we cannot strip "Re:" for MIME encoded subject without modifying the original
|
||||
if (modifiedSubject && strstr(*stringP, "=?"))
|
||||
|
@ -534,7 +534,7 @@ PRBool NS_MsgStripRE(const char **stringP, PRUint32 *lengthP, char **modifiedSub
|
|||
rv = mimeConverter->DecodeMimeHeader(*stringP, getter_Copies(decodedString));
|
||||
}
|
||||
|
||||
s = decodedString ? decodedString.get() : *stringP;
|
||||
s = !decodedString.IsEmpty() ? decodedString.get() : *stringP;
|
||||
L = lengthP ? *lengthP : strlen(s);
|
||||
|
||||
s_end = s + L;
|
||||
|
@ -585,7 +585,7 @@ PRBool NS_MsgStripRE(const char **stringP, PRUint32 *lengthP, char **modifiedSub
|
|||
tokPtr++;
|
||||
}
|
||||
|
||||
if (decodedString)
|
||||
if (!decodedString.IsEmpty())
|
||||
{
|
||||
// encode the string back if any modification is made
|
||||
if (s != decodedString.get())
|
||||
|
@ -683,7 +683,7 @@ nsresult NS_MsgDecodeUnescapeURLPath(const nsACString& aPath,
|
|||
nsAString& aResult)
|
||||
{
|
||||
nsCAutoString unescapedName;
|
||||
NS_UnescapeURL(PromiseFlatCString(aPath),
|
||||
NS_UnescapeURL(nsCString(aPath),
|
||||
esc_FileBaseName|esc_Forced|esc_AlwaysCopy,
|
||||
unescapedName);
|
||||
CopyUTF8toUTF16(unescapedName, aResult);
|
||||
|
@ -920,7 +920,7 @@ nsresult IsRSSArticle(nsIURI * aMsgURI, PRBool *aIsRSSArticle)
|
|||
nsCOMPtr<nsIMsgMessageUrl> msgUrl = do_QueryInterface(aMsgURI, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsXPIDLCString resourceURI;
|
||||
nsCString resourceURI;
|
||||
msgUrl->GetUri(getter_Copies(resourceURI));
|
||||
|
||||
// get the msg service for this URI
|
||||
|
@ -929,7 +929,7 @@ nsresult IsRSSArticle(nsIURI * aMsgURI, PRBool *aIsRSSArticle)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgDBHdr> msgHdr;
|
||||
rv = msgService->MessageURIToMsgHdr(resourceURI, getter_AddRefs(msgHdr));
|
||||
rv = msgService->MessageURIToMsgHdr(resourceURI.get(), getter_AddRefs(msgHdr));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aMsgURI, &rv);
|
||||
|
@ -1407,7 +1407,7 @@ nsresult MsgMailboxGetURI(const char *uriPath, nsCString &mailboxUri)
|
|||
nsCOMPtr<nsIFileURL> theFileURL = do_QueryInterface(fileURI, &rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
nsXPIDLCString serverPath;
|
||||
nsCString serverPath;
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
fileURI->GetSpec(serverPath);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче