--- a/calendar/base/backend/libical/calUtils.cpp
+++ b/calendar/base/backend/libical/calUtils.cpp
@@ -23,17 +23,17 @@ nsresult logError(const nsAString& msg)
nsresult logWarning(const nsAString& msg) {
nsresult rc;
nsCOMPtr<nsIScriptError> const scriptError(do_CreateInstance("@mozilla.org/scripterror;1", &rc));
NS_ENSURE_SUCCESS(rc, rc);
rc = scriptError->Init(msg, EmptyString(), EmptyString(), 0, 0, nsIScriptError::warningFlag, "calendar");
return getConsoleService()->LogMessage(scriptError);
}
-nsresult log(PRUnichar const* msg) {
+nsresult log(char16_t const* msg) {
return getConsoleService()->LogStringMessage(msg);
}
nsCOMPtr<calITimezone> detectTimezone(icaltimetype const& icalt,
calITimezoneProvider * tzProvider)
{
if (icalt.is_utc) {
return UTC();
--- a/calendar/base/backend/libical/calUtils.h
+++ b/calendar/base/backend/libical/calUtils.h
@@ -83,17 +83,17 @@ inline nsresult logWarning(char const* m
}
inline nsresult logWarning(nsACString const& msg) {
return logWarning(NS_ConvertASCIItoUTF16(msg));
}
/**
* Just logs.
*/
-nsresult log(PRUnichar const* msg);
+nsresult log(char16_t const* msg);
inline nsresult log(char const* msg) {
return log(NS_ConvertASCIItoUTF16(msg).get());
}
inline nsresult log(nsACString const& msg) {
return log(NS_ConvertASCIItoUTF16(msg).get());
}
// some timezone helpers
--- a/ldap/xpcom/src/nsLDAPConnection.cpp
+++ b/ldap/xpcom/src/nsLDAPConnection.cpp
@@ -216,17 +216,17 @@ GetListOfPendingOperations(const uint32_
{
nsTArray<nsILDAPOperation*>* pending_operations = static_cast<nsTArray<nsILDAPOperation*>* >(userArg);
pending_operations->AppendElement(op);
return PL_DHASH_NEXT;
}
NS_IMETHODIMP
nsLDAPConnection::Observe(nsISupports *aSubject, const char *aTopic,
- const PRUnichar *aData)
+ const char16_t *aData)
{
if (!strcmp(aTopic, "profile-change-net-teardown")) {
// Abort all ldap requests.
/* We cannot use enumerate function to abort operations because
* nsILDAPOperation::AbandonExt() is modifying list of operations
* and this leads to starvation.
* We have to do a copy of pending operations.
*/
@@ -292,17 +292,17 @@ nsLDAPConnection::GetLdErrno(nsACString&
}
// return the error string corresponding to GetLdErrno.
//
// XXX - deal with optional params
// XXX - how does ldap_perror know to look at the global errno?
//
NS_IMETHODIMP
-nsLDAPConnection::GetErrorString(PRUnichar **_retval)
+nsLDAPConnection::GetErrorString(char16_t **_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
// get the error string
//
char *rv = ldap_err2string(ldap_get_lderrno(mConnectionHandle, 0, 0));
if (!rv) {
return NS_ERROR_OUT_OF_MEMORY;
--- a/ldap/xpcom/src/nsLDAPMessage.cpp
+++ b/ldap/xpcom/src/nsLDAPMessage.cpp
@@ -444,17 +444,17 @@ NS_IMETHODIMP nsLDAPMessage::GetDn(nsACS
return NS_OK;
}
// wrapper for ldap_get_values()
//
NS_IMETHODIMP
nsLDAPMessage::GetValues(const char *aAttr, uint32_t *aCount,
- PRUnichar ***aValues)
+ char16_t ***aValues)
{
char **values;
#if defined(DEBUG)
// We only want this being logged for debug builds so as not to affect performance too much.
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
("nsLDAPMessage::GetValues(): called with aAttr = '%s'", aAttr));
#endif
@@ -486,17 +486,17 @@ nsLDAPMessage::GetValues(const char *aAt
}
// count the values
//
uint32_t numVals = ldap_count_values(values);
// create an array of the appropriate size
//
- *aValues = static_cast<PRUnichar **>(nsMemory::Alloc(numVals * sizeof(PRUnichar *)));
+ *aValues = static_cast<char16_t **>(nsMemory::Alloc(numVals * sizeof(char16_t *)));
if (!*aValues) {
ldap_value_free(values);
return NS_ERROR_OUT_OF_MEMORY;
}
// clone the array (except for the trailing NULL entry) using the
// shared allocator for XPCOM correctness
//
@@ -623,17 +623,17 @@ NS_IMETHODIMP nsLDAPMessage::GetOperatio
return NS_ERROR_NULL_POINTER;
}
NS_IF_ADDREF(*_retval = mOperation);
return NS_OK;
}
NS_IMETHODIMP
-nsLDAPMessage::ToUnicode(PRUnichar* *aString)
+nsLDAPMessage::ToUnicode(char16_t* *aString)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsLDAPMessage::GetErrorMessage(nsACString & aErrorMessage)
{
aErrorMessage.Assign(mErrorMessage);
--- a/ldap/xpcom/src/nsLDAPServer.cpp
+++ b/ldap/xpcom/src/nsLDAPServer.cpp
@@ -14,31 +14,31 @@ nsLDAPServer::nsLDAPServer()
{
}
nsLDAPServer::~nsLDAPServer()
{
}
// attribute wstring key;
-NS_IMETHODIMP nsLDAPServer::GetKey(PRUnichar **_retval)
+NS_IMETHODIMP nsLDAPServer::GetKey(char16_t **_retval)
{
if (!_retval) {
NS_ERROR("nsLDAPServer::GetKey: null pointer ");
return NS_ERROR_NULL_POINTER;
}
*_retval = ToNewUnicode(mKey);
if (!*_retval) {
return NS_ERROR_OUT_OF_MEMORY;
}
return NS_OK;
}
-NS_IMETHODIMP nsLDAPServer::SetKey(const PRUnichar *aKey)
+NS_IMETHODIMP nsLDAPServer::SetKey(const char16_t *aKey)
{
mKey = aKey;
return NS_OK;
}
// attribute AUTF8String username;
NS_IMETHODIMP nsLDAPServer::GetUsername(nsACString& _retval)
{
--- a/ldap/xpcom/src/nsLDAPService.cpp
+++ b/ldap/xpcom/src/nsLDAPService.cpp
@@ -255,17 +255,17 @@ NS_IMETHODIMP nsLDAPService::AddServer(n
mServers.Put(key, entry);
}
NS_ADDREF(aServer);
return NS_OK;
}
// void deleteServer (in wstring aKey);
-NS_IMETHODIMP nsLDAPService::DeleteServer(const PRUnichar *aKey)
+NS_IMETHODIMP nsLDAPService::DeleteServer(const char16_t *aKey)
{
nsLDAPServiceEntry *entry;
MutexAutoLock lock(mLock);
// We should probably rename the key for this entry now that it's
// "deleted", so that we can add in a new one with the same ID.
// This is bug #77669.
//
@@ -280,17 +280,17 @@ NS_IMETHODIMP nsLDAPService::DeleteServe
//
return NS_ERROR_FAILURE;
}
return NS_OK;
}
// nsILDAPServer getServer (in wstring aKey);
-NS_IMETHODIMP nsLDAPService::GetServer(const PRUnichar *aKey,
+NS_IMETHODIMP nsLDAPService::GetServer(const char16_t *aKey,
nsILDAPServer **_retval)
{
nsLDAPServiceEntry *entry;
MutexAutoLock lock(mLock);
if (!_retval) {
NS_ERROR("nsLDAPService::GetServer: null pointer ");
return NS_ERROR_NULL_POINTER;
@@ -304,17 +304,17 @@ NS_IMETHODIMP nsLDAPService::GetServer(c
return NS_ERROR_FAILURE;
}
return NS_OK;
}
//void requestConnection (in wstring aKey,
// in nsILDAPMessageListener aMessageListener);
-NS_IMETHODIMP nsLDAPService::RequestConnection(const PRUnichar *aKey,
+NS_IMETHODIMP nsLDAPService::RequestConnection(const char16_t *aKey,
nsILDAPMessageListener *aListener)
{
nsLDAPServiceEntry *entry;
nsCOMPtr<nsILDAPConnection> conn;
nsCOMPtr<nsILDAPMessage> message;
nsresult rv;
if (!aListener) {
@@ -365,17 +365,17 @@ NS_IMETHODIMP nsLDAPService::RequestConn
return NS_ERROR_FAILURE;
}
}
return NS_OK;
}
// nsILDAPConnection getConnection (in wstring aKey);
-NS_IMETHODIMP nsLDAPService::GetConnection(const PRUnichar *aKey,
+NS_IMETHODIMP nsLDAPService::GetConnection(const char16_t *aKey,
nsILDAPConnection **_retval)
{
nsLDAPServiceEntry *entry;
MutexAutoLock lock(mLock);
if (!_retval) {
NS_ERROR("nsLDAPService::GetConnection: null pointer ");
return NS_ERROR_NULL_POINTER;
@@ -390,17 +390,17 @@ NS_IMETHODIMP nsLDAPService::GetConnecti
if (!(*_retval = entry->GetConnection().get())){
return NS_ERROR_FAILURE;
}
return NS_OK;
}
// void releaseConnection (in wstring aKey);
-NS_IMETHODIMP nsLDAPService::ReleaseConnection(const PRUnichar *aKey)
+NS_IMETHODIMP nsLDAPService::ReleaseConnection(const char16_t *aKey)
{
nsLDAPServiceEntry *entry;
MutexAutoLock lock(mLock);
if (!mServers.Get(nsDependentString(aKey), &entry)) {
return NS_ERROR_FAILURE;
}
@@ -412,17 +412,17 @@ NS_IMETHODIMP nsLDAPService::ReleaseConn
//
}
return NS_OK;
}
// void reconnectConnection (in wstring aKey,
// in nsILDAPMessageListener aMessageListener);
-NS_IMETHODIMP nsLDAPService::ReconnectConnection(const PRUnichar *aKey,
+NS_IMETHODIMP nsLDAPService::ReconnectConnection(const char16_t *aKey,
nsILDAPMessageListener *aListener)
{
nsLDAPServiceEntry *entry;
nsresult rv;
if (!aListener) {
NS_ERROR("nsLDAPService::ReconnectConnection: null pointer ");
return NS_ERROR_NULL_POINTER;
--- a/ldap/xpcom/src/nsLDAPSyncQuery.cpp
+++ b/ldap/xpcom/src/nsLDAPSyncQuery.cpp
@@ -167,35 +167,35 @@ nsLDAPSyncQuery::OnLDAPSearchEntry(nsILD
"aMessage->GetAttributes() failed");
FinishLDAPQuery();
return rv;
}
// Iterate through the attributes received in this message
for (uint32_t i = 0; i < attrCount; i++)
{
- PRUnichar **vals;
+ char16_t **vals;
uint32_t valueCount;
// Get the values of this attribute.
// XXX better failure handling
rv = aMessage->GetValues(attributes[i], &valueCount, &vals);
if (NS_FAILED(rv))
{
NS_WARNING("nsLDAPSyncQuery:OnLDAPSearchEntry(): "
"aMessage->GetValues() failed\n");
FinishLDAPQuery();
break;
}
// Store all values of this attribute in the mResults.
for (uint32_t j = 0; j < valueCount; j++) {
- mResults.Append(PRUnichar('\n'));
+ mResults.Append(char16_t('\n'));
mResults.AppendASCII(attributes[i]);
- mResults.Append(PRUnichar('='));
+ mResults.Append(char16_t('='));
mResults.Append(vals[j]);
}
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(valueCount, vals);
}
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(attrCount, attributes);
return rv;
@@ -334,17 +334,17 @@ nsLDAPSyncQuery::FinishLDAPQuery()
mOperation = 0;
mServerURL = 0;
}
/* wstring getQueryResults (in nsILDAPURL aServerURL, in unsigned long aVersion); */
NS_IMETHODIMP nsLDAPSyncQuery::GetQueryResults(nsILDAPURL *aServerURL,
uint32_t aProtocolVersion,
- PRUnichar **_retval)
+ char16_t **_retval)
{
nsresult rv;
if (!aServerURL) {
NS_ERROR("nsLDAPSyncQuery::GetQueryResults() called without LDAP URL");
return NS_ERROR_FAILURE;
}
mServerURL = aServerURL;
--- a/mail/app/nsMailApp.cpp
+++ b/mail/app/nsMailApp.cpp
@@ -37,17 +37,17 @@
#include "mozilla/Telemetry.h"
static void Output(const char *fmt, ... )
{
va_list ap;
va_start(ap, fmt);
#if defined(XP_WIN) && !MOZ_WINCONSOLE
- PRUnichar msg[2048];
+ char16_t msg[2048];
_vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
MessageBoxW(NULL, msg, L"XULRunner", MB_OK | MB_ICONERROR);
#else
vfprintf(stderr, fmt, ap);
#endif
va_end(ap);
}
--- a/mail/components/migration/src/nsEudoraProfileMigrator.cpp
+++ b/mail/components/migration/src/nsEudoraProfileMigrator.cpp
@@ -66,17 +66,17 @@ nsEudoraProfileMigrator::Notify(nsITimer
}
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsEudoraProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsEudoraProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const char16_t* aProfile)
{
nsresult rv = NS_OK;
if (aStartup)
{
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -89,17 +89,17 @@ nsEudoraProfileMigrator::Migrate(uint16_
// the final migration step, copying the mail folders over.
rv = ImportAddressBook(mImportModule);
// don't broadcast an on end migration here. We aren't done until our asynch import process says we are done.
return rv;
}
NS_IMETHODIMP
-nsEudoraProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
+nsEudoraProfileMigrator::GetMigrateData(const char16_t* aProfile,
bool aReplace,
uint16_t* aResult)
{
// There's no harm in assuming everything is available.
*aResult = nsIMailProfileMigrator::ACCOUNT_SETTINGS | nsIMailProfileMigrator::ADDRESSBOOK_DATA |
nsIMailProfileMigrator::MAILDATA | nsIMailProfileMigrator::FILTERS;
return NS_OK;
}
--- a/mail/components/migration/src/nsMailProfileMigratorUtils.h
+++ b/mail/components/migration/src/nsMailProfileMigratorUtils.h
@@ -31,17 +31,17 @@
class nsIProfileStartup;
// Proxy utilities shared by the Opera and IE migrators
void ParseOverrideServers(const char* aServers, nsIPrefBranch* aBranch);
void SetProxyPref(const nsACString& aHostPort, const char* aPref,
const char* aPortPref, nsIPrefBranch* aPrefs);
struct MigrationData {
- PRUnichar* fileName;
+ char16_t* fileName;
uint32_t sourceFlag;
bool replaceOnly;
};
class nsIFile;
void GetMigrateDataFromArray(MigrationData* aDataArray,
int32_t aDataArrayLength,
bool aReplace,
--- a/mail/components/migration/src/nsOEProfileMigrator.cpp
+++ b/mail/components/migration/src/nsOEProfileMigrator.cpp
@@ -63,17 +63,17 @@ nsOEProfileMigrator::Notify(nsITimer *ti
}
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsOEProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsOEProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const char16_t* aProfile)
{
nsresult rv = NS_OK;
if (aStartup)
{
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -86,17 +86,17 @@ nsOEProfileMigrator::Migrate(uint16_t aI
// the final migration step, copying the mail folders over.
rv = ImportAddressBook(mImportModule);
// don't broadcast an on end migration here. We aren't done until our asynch import process says we are done.
return rv;
}
NS_IMETHODIMP
-nsOEProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
+nsOEProfileMigrator::GetMigrateData(const char16_t* aProfile,
bool aReplace,
uint16_t* aResult)
{
// There's no harm in assuming everything is available.
*aResult = nsIMailProfileMigrator::ACCOUNT_SETTINGS | nsIMailProfileMigrator::ADDRESSBOOK_DATA |
nsIMailProfileMigrator::MAILDATA;
return NS_OK;
}
--- a/mail/components/migration/src/nsOutlookProfileMigrator.cpp
+++ b/mail/components/migration/src/nsOutlookProfileMigrator.cpp
@@ -58,17 +58,17 @@ nsOutlookProfileMigrator::Notify(nsITime
}
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsOutlookProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsOutlookProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const char16_t* aProfile)
{
nsresult rv = NS_OK;
if (aStartup)
{
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -82,17 +82,17 @@ nsOutlookProfileMigrator::Migrate(uint16
// the final migration step, copying the mail folders over.
rv = ImportAddressBook(mImportModule);
// don't broadcast an on end migration here. We aren't done until our asynch import process says we are done.
return rv;
}
NS_IMETHODIMP
-nsOutlookProfileMigrator::GetMigrateData(const PRUnichar* aProfile, bool aReplace, uint16_t* aResult)
+nsOutlookProfileMigrator::GetMigrateData(const char16_t* aProfile, bool aReplace, uint16_t* aResult)
{
// There's no harm in assuming everything is available.
*aResult = nsIMailProfileMigrator::ACCOUNT_SETTINGS | nsIMailProfileMigrator::ADDRESSBOOK_DATA |
nsIMailProfileMigrator::MAILDATA;
return NS_OK;
}
NS_IMETHODIMP
--- a/mail/components/migration/src/nsProfileMigratorBase.cpp
+++ b/mail/components/migration/src/nsProfileMigratorBase.cpp
@@ -142,17 +142,17 @@ nsresult nsProfileMigratorBase::ImportFi
if (NS_SUCCEEDED(rv2))
{
nsAutoString index;
index.AppendInt(nsIMailProfileMigrator::FILTERS);
NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());
bool importedFilters = false;
- PRUnichar* error;
+ char16_t* error;
rv = importFilters->Import(&error, &importedFilters);
NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get());
}
// migration is now done...notify the UI.
NOTIFY_OBSERVERS(MIGRATION_ENDED, nullptr);
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -35,17 +35,17 @@
struct PrefBranchStruct {
char* prefName;
int32_t type;
union {
char* stringValue;
int32_t intValue;
bool boolValue;
- PRUnichar* wstringValue;
+ char16_t* wstringValue;
};
};
NS_IMPL_ISUPPORTS2(nsSeamonkeyProfileMigrator, nsIMailProfileMigrator, nsITimerCallback)
nsSeamonkeyProfileMigrator::nsSeamonkeyProfileMigrator()
{
@@ -54,17 +54,17 @@ nsSeamonkeyProfileMigrator::nsSeamonkeyP
nsSeamonkeyProfileMigrator::~nsSeamonkeyProfileMigrator()
{
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsSeamonkeyProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsSeamonkeyProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const char16_t* aProfile)
{
nsresult rv = NS_OK;
bool aReplace = aStartup ? true : false;
if (!mTargetProfile) {
GetProfilePath(aStartup, mTargetProfile);
if (!mTargetProfile) return NS_ERROR_FAILURE;
}
@@ -105,17 +105,17 @@ nsSeamonkeyProfileMigrator::Migrate(uint
}
CopyNextFolder();
return rv;
}
NS_IMETHODIMP
-nsSeamonkeyProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
+nsSeamonkeyProfileMigrator::GetMigrateData(const char16_t* aProfile,
bool aReplace,
uint16_t* aResult)
{
*aResult = 0;
if (!mSourceProfile) {
GetSourceProfile(aProfile);
if (!mSourceProfile)
@@ -180,17 +180,17 @@ nsSeamonkeyProfileMigrator::GetSourcePro
NS_IF_ADDREF(*aResult = mProfileNames);
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsSeamonkeyProfileMigrator
nsresult
-nsSeamonkeyProfileMigrator::GetSourceProfile(const PRUnichar* aProfile)
+nsSeamonkeyProfileMigrator::GetSourceProfile(const char16_t* aProfile)
{
uint32_t count;
mProfileNames->GetLength(&count);
for (uint32_t i = 0; i < count; ++i) {
nsCOMPtr<nsISupportsString> str(do_QueryElementAt(mProfileNames, i));
nsString profileName;
str->GetData(profileName);
if (profileName.Equals(aProfile)) {
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.h
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.h
@@ -18,24 +18,24 @@ class nsSeamonkeyProfileMigrator : publi
public:
NS_DECL_ISUPPORTS
nsSeamonkeyProfileMigrator();
virtual ~nsSeamonkeyProfileMigrator();
// nsIMailProfileMigrator methods
NS_IMETHOD Migrate(uint16_t aItems, nsIProfileStartup* aStartup,
- const PRUnichar* aProfile);
- NS_IMETHOD GetMigrateData(const PRUnichar* aProfile, bool aReplace,
+ const char16_t* aProfile);
+ NS_IMETHOD GetMigrateData(const char16_t* aProfile, bool aReplace,
uint16_t* aResult);
NS_IMETHOD GetSourceProfiles(nsIArray** aResult);
protected:
nsresult FillProfileDataFromSeamonkeyRegistry();
- nsresult GetSourceProfile(const PRUnichar* aProfile);
+ nsresult GetSourceProfile(const char16_t* aProfile);
nsresult CopyPreferences(bool aReplace);
nsresult TransformPreferences(const nsAString& aSourcePrefFileName,
const nsAString& aTargetPrefFileName);
nsresult DummyCopyRoutine(bool aReplace);
nsresult CopyJunkTraining(bool aReplace);
nsresult CopyPasswords(bool aReplace);
--- a/mail/components/shell/nsMailWinIntegration.cpp
+++ b/mail/components/shell/nsMailWinIntegration.cpp
@@ -229,17 +229,17 @@ nsWindowsShellService::ShortcutMaintenan
params.AssignLiteral(" /UpdateShortcutAppUserModelIds");
return LaunchHelper(appHelperPath, params);
}
nsresult nsWindowsShellService::Init()
{
nsresult rv;
- PRUnichar appPath[MAX_BUF];
+ char16_t appPath[MAX_BUF];
if (!::GetModuleFileNameW(0, appPath, MAX_BUF))
return NS_ERROR_FAILURE;
// Convert the path to a long path since GetModuleFileNameW returns the path
// that was used to launch the app which is not necessarily a long path.
if (!::GetLongPathNameW(appPath, appPath, MAX_BUF))
return NS_ERROR_FAILURE;
@@ -335,17 +335,17 @@ nsWindowsShellService::SetShouldCheckDef
return prefs->SetBoolPref("mail.shell.checkDefaultClient", aShouldCheck);
}
/* helper routine. Iterate over the passed in settings object. */
bool
nsWindowsShellService::TestForDefault(SETTING aSettings[], int32_t aSize)
{
bool isDefault = true;
- PRUnichar currValue[MAX_BUF];
+ char16_t currValue[MAX_BUF];
SETTING* end = aSettings + aSize;
for (SETTING * settings = aSettings; settings < end; ++settings)
{
NS_ConvertUTF8toUTF16 dataLongPath(settings->valueData);
NS_ConvertUTF8toUTF16 key(settings->keyName);
NS_ConvertUTF8toUTF16 value(settings->valueName);
if (settings->flags & APP_PATH_SUBSTITUTION)
{
--- a/mailnews/addrbook/src/nsAbAddressCollector.cpp
+++ b/mailnews/addrbook/src/nsAbAddressCollector.cpp
@@ -272,17 +272,17 @@ nsAbAddressCollector::SplitFullName(cons
aLastName = Substring(aFullName, index + 1);
aFirstName = Substring(aFullName, 0, index);
}
}
// Observes the collected address book pref in case it changes.
NS_IMETHODIMP
nsAbAddressCollector::Observe(nsISupports *aSubject, const char *aTopic,
- const PRUnichar *aData)
+ const char16_t *aData)
{
nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(aSubject);
if (!prefBranch) {
NS_ASSERTION(prefBranch, "failed to get prefs");
return NS_OK;
}
SetUpAbFromPrefs(prefBranch);
--- a/mailnews/addrbook/src/nsAbBooleanExpression.cpp
+++ b/mailnews/addrbook/src/nsAbBooleanExpression.cpp
@@ -51,26 +51,26 @@ NS_IMETHODIMP nsAbBooleanConditionString
return NS_ERROR_NULL_POINTER;
mName = aName;
return NS_OK;
}
/* attribute wstring value; */
-NS_IMETHODIMP nsAbBooleanConditionString::GetValue(PRUnichar** aValue)
+NS_IMETHODIMP nsAbBooleanConditionString::GetValue(char16_t** aValue)
{
if (!aValue)
return NS_ERROR_NULL_POINTER;
*aValue = ToNewUnicode(mValue);
return NS_OK;
}
-NS_IMETHODIMP nsAbBooleanConditionString::SetValue(const PRUnichar * aValue)
+NS_IMETHODIMP nsAbBooleanConditionString::SetValue(const char16_t * aValue)
{
if (!aValue)
return NS_ERROR_NULL_POINTER;
mValue = aValue;
return NS_OK;
}
--- a/mailnews/addrbook/src/nsAbCardProperty.cpp
+++ b/mailnews/addrbook/src/nsAbCardProperty.cpp
@@ -495,17 +495,17 @@ NS_IMETHODIMP nsAbCardProperty::Translat
return NS_OK;
}
else if (type.EqualsLiteral("vcard"))
return ConvertToEscapedVCard(result);
return NS_ERROR_ILLEGAL_VALUE;
}
//
-static VObject* myAddPropValue(VObject *o, const char *propName, const PRUnichar *propValue, bool *aCardHasData)
+static VObject* myAddPropValue(VObject *o, const char *propName, const char16_t *propValue, bool *aCardHasData)
{
if (aCardHasData)
*aCardHasData = true;
return addPropValue(o, propName, NS_ConvertUTF16toUTF8(propValue).get());
}
nsresult nsAbCardProperty::ConvertToEscapedVCard(nsACString &aResult)
{
@@ -953,29 +953,29 @@ nsresult nsAbCardProperty::AppendLine(co
NS_ENSURE_ARG_POINTER(aConv);
nsString attrValue;
nsresult rv = GetPropertyAsAString(aItem.mColumn, attrValue);
if (NS_FAILED(rv) || attrValue.IsEmpty())
return NS_OK;
- aResult.Append(PRUnichar('<'));
+ aResult.Append(char16_t('<'));
aResult.Append(NS_ConvertUTF8toUTF16(aItem.mColumn));
- aResult.Append(PRUnichar('>'));
+ aResult.Append(char16_t('>'));
// use ScanTXT to convert < > & to safe values.
nsString safeText;
rv = aConv->ScanTXT(attrValue.get(), mozITXTToHTMLConv::kEntities, getter_Copies(safeText));
NS_ENSURE_SUCCESS(rv,rv);
aResult.Append(safeText);
aResult.AppendLiteral("</");
aResult.Append(NS_ConvertUTF8toUTF16(aItem.mColumn));
- aResult.Append(PRUnichar('>'));
+ aResult.Append(char16_t('>'));
return NS_OK;
}
nsresult nsAbCardProperty::AppendLabel(const AppendItem &aItem,
nsIStringBundle *aBundle,
mozITXTToHTMLConv *aConv,
nsString &aResult)
@@ -1040,28 +1040,28 @@ nsresult nsAbCardProperty::AppendCitySta
item.mColumn = zipPropName;
rv = AppendLine(item, aConv, zipResult);
NS_ENSURE_SUCCESS(rv,rv);
nsString formattedString;
if (!cityResult.IsEmpty() && !stateResult.IsEmpty() && !zipResult.IsEmpty()) {
- const PRUnichar *formatStrings[] = { cityResult.get(), stateResult.get(), zipResult.get() };
+ const char16_t *formatStrings[] = { cityResult.get(), stateResult.get(), zipResult.get() };
rv = aBundle->FormatStringFromName(MOZ_UTF16("cityAndStateAndZip"), formatStrings, ArrayLength(formatStrings), getter_Copies(formattedString));
NS_ENSURE_SUCCESS(rv,rv);
}
else if (!cityResult.IsEmpty() && !stateResult.IsEmpty() && zipResult.IsEmpty()) {
- const PRUnichar *formatStrings[] = { cityResult.get(), stateResult.get() };
+ const char16_t *formatStrings[] = { cityResult.get(), stateResult.get() };
rv = aBundle->FormatStringFromName(MOZ_UTF16("cityAndStateNoZip"), formatStrings, ArrayLength(formatStrings), getter_Copies(formattedString));
NS_ENSURE_SUCCESS(rv,rv);
}
else if ((!cityResult.IsEmpty() && stateResult.IsEmpty() && !zipResult.IsEmpty()) ||
(cityResult.IsEmpty() && !stateResult.IsEmpty() && !zipResult.IsEmpty())) {
- const PRUnichar *formatStrings[] = { cityResult.IsEmpty() ? stateResult.get() : cityResult.get(), zipResult.get() };
+ const char16_t *formatStrings[] = { cityResult.IsEmpty() ? stateResult.get() : cityResult.get(), zipResult.get() };
rv = aBundle->FormatStringFromName(MOZ_UTF16("cityOrStateAndZip"), formatStrings, ArrayLength(formatStrings), getter_Copies(formattedString));
NS_ENSURE_SUCCESS(rv,rv);
}
else {
if (!cityResult.IsEmpty())
formattedString = cityResult;
else if (!stateResult.IsEmpty())
formattedString = stateResult;
@@ -1104,23 +1104,23 @@ NS_IMETHODIMP nsAbCardProperty::Generate
rv = stringBundleService->CreateBundle(sAddrbookProperties,
getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
}
nsString result;
if (aGenerateFormat == GENERATE_LAST_FIRST_ORDER) {
- const PRUnichar *stringParams[2] = {lastName.get(), firstName.get()};
+ const char16_t *stringParams[2] = {lastName.get(), firstName.get()};
rv = bundle->FormatStringFromName(MOZ_UTF16("lastFirstFormat"),
stringParams, 2, getter_Copies(result));
}
else {
- const PRUnichar *stringParams[2] = {firstName.get(), lastName.get()};
+ const char16_t *stringParams[2] = {firstName.get(), lastName.get()};
rv = bundle->FormatStringFromName(MOZ_UTF16("firstLastFormat"),
stringParams, 2, getter_Copies(result));
}
NS_ENSURE_SUCCESS(rv, rv);
aResult.Assign(result);
}
--- a/mailnews/addrbook/src/nsAbDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbDirectoryQuery.cpp
@@ -159,17 +159,17 @@ NS_IMETHODIMP nsAbDirectoryQueryArgument
NS_IMPL_ISUPPORTS1(nsAbDirectoryQueryPropertyValue, nsIAbDirectoryQueryPropertyValue)
nsAbDirectoryQueryPropertyValue::nsAbDirectoryQueryPropertyValue()
{
}
nsAbDirectoryQueryPropertyValue::nsAbDirectoryQueryPropertyValue(const char* aName,
- const PRUnichar* aValue)
+ const char16_t* aValue)
{
mName = aName;
mValue = aValue;
}
nsAbDirectoryQueryPropertyValue::nsAbDirectoryQueryPropertyValue(const char* aName,
nsISupports* aValueISupports)
{
@@ -185,17 +185,17 @@ nsAbDirectoryQueryPropertyValue::~nsAbDi
NS_IMETHODIMP nsAbDirectoryQueryPropertyValue::GetName(char* *aName)
{
*aName = mName.IsEmpty() ? 0 : ToNewCString(mName);
return NS_OK;
}
/* read only attribute wstring value; */
-NS_IMETHODIMP nsAbDirectoryQueryPropertyValue::GetValue(PRUnichar* *aValue)
+NS_IMETHODIMP nsAbDirectoryQueryPropertyValue::GetValue(char16_t* *aValue)
{
*aValue = ToNewUnicode(mValue);
if (!(*aValue))
return NS_ERROR_OUT_OF_MEMORY;
else
return NS_OK;
}
--- a/mailnews/addrbook/src/nsAbDirectoryQuery.h
+++ b/mailnews/addrbook/src/nsAbDirectoryQuery.h
@@ -48,17 +48,17 @@ protected:
class nsAbDirectoryQueryPropertyValue : public nsIAbDirectoryQueryPropertyValue
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIABDIRECTORYQUERYPROPERTYVALUE
nsAbDirectoryQueryPropertyValue();
nsAbDirectoryQueryPropertyValue(const char* aName,
- const PRUnichar* aValue);
+ const char16_t* aValue);
nsAbDirectoryQueryPropertyValue(const char* aName,
nsISupports* aValueISupports);
virtual ~nsAbDirectoryQueryPropertyValue();
protected:
nsCString mName;
nsString mValue;
nsCOMPtr<nsISupports> mValueISupports;
--- a/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPListenerBase.cpp
@@ -123,24 +123,24 @@ NS_IMETHODIMP nsAbLDAPListenerBase::OnLD
return rv;
}
// hostTemp is only necessary to work around a code-generation
// bug in egcs 1.1.2 (the version of gcc that comes with Red Hat 6.2),
// which is the default compiler for Mozilla on linux at the moment.
//
NS_ConvertASCIItoUTF16 hostTemp(host);
- const PRUnichar *hostArray[1] = { hostTemp.get() };
+ const char16_t *hostArray[1] = { hostTemp.get() };
// format the hostname into the authprompt text string
//
nsString authPromptText;
rv = ldapBundle->FormatStringFromName(MOZ_UTF16("authPromptText"),
hostArray,
- sizeof(hostArray) / sizeof(const PRUnichar *),
+ sizeof(hostArray) / sizeof(const char16_t *),
getter_Copies(authPromptText));
if (NS_FAILED(rv))
{
NS_ERROR("nsAbLDAPListenerBase::OnLDAPInit():"
"error getting 'authPromptText' string from bundle "
"chrome://mozldap/locale/ldap.properties");
InitFailed();
return rv;
--- a/mailnews/addrbook/src/nsAbMDBDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbMDBDirectory.cpp
@@ -210,17 +210,17 @@ nsresult nsAbMDBDirectory::NotifyItemCha
nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
rv = abManager->NotifyItemPropertyChanged(item, nullptr, nullptr, nullptr);
NS_ENSURE_SUCCESS(rv,rv);
return rv;
}
-nsresult nsAbMDBDirectory::NotifyPropertyChanged(nsIAbDirectory *list, const char *property, const PRUnichar* oldValue, const PRUnichar* newValue)
+nsresult nsAbMDBDirectory::NotifyPropertyChanged(nsIAbDirectory *list, const char *property, const char16_t* oldValue, const char16_t* newValue)
{
nsresult rv;
nsCOMPtr<nsISupports> supports = do_QueryInterface(list, &rv);
NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
--- a/mailnews/addrbook/src/nsAbMDBDirectory.h
+++ b/mailnews/addrbook/src/nsAbMDBDirectory.h
@@ -78,17 +78,17 @@ public:
// nsIAbDirectorySearch methods
NS_DECL_NSIABDIRECTORYSEARCH
// nsIAbDirSearchListener methods
NS_DECL_NSIABDIRSEARCHLISTENER
protected:
- nsresult NotifyPropertyChanged(nsIAbDirectory *list, const char *property, const PRUnichar* oldValue, const PRUnichar* newValue);
+ nsresult NotifyPropertyChanged(nsIAbDirectory *list, const char *property, const char16_t* oldValue, const char16_t* newValue);
nsresult NotifyItemAdded(nsISupports *item);
nsresult NotifyItemDeleted(nsISupports *item);
nsresult NotifyItemChanged(nsISupports *item);
nsresult RemoveCardFromAddressList(nsIAbCard* card);
nsresult GetAbDatabase();
nsCOMPtr<nsIAddrDatabase> mDatabase;
--- a/mailnews/addrbook/src/nsAbManager.cpp
+++ b/mailnews/addrbook/src/nsAbManager.cpp
@@ -145,17 +145,17 @@ nsresult nsAbManager::Init()
rv = observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID,
false);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
NS_IMETHODIMP nsAbManager::Observe(nsISupports *aSubject, const char *aTopic,
- const PRUnichar *someData)
+ const char16_t *someData)
{
// The nsDirPrefs code caches all the directories that it got
// from the first profiles prefs.js.
// When we profile switch, we need to force it to shut down.
// We'll re-load all the directories from the second profiles prefs.js
// that happens in nsAbBSDirectory::GetChildNodes()
// when we call DIR_GetDirectories().
if (!strcmp(aTopic, "profile-do-change"))
@@ -382,18 +382,18 @@ NS_IMETHODIMP nsAbManager::RemoveAddress
const abListener &abL = iter.GetNext(); \
if (abL.mNotifyFlags & nsIAbListener::propertyflag_) \
abL.mListener->propertyfunc_ params_; \
} \
PR_END_MACRO
NS_IMETHODIMP nsAbManager::NotifyItemPropertyChanged(nsISupports *aItem,
const char *aProperty,
- const PRUnichar* aOldValue,
- const PRUnichar* aNewValue)
+ const char16_t* aOldValue,
+ const char16_t* aNewValue)
{
NOTIFY_AB_LISTENERS(itemChanged, OnItemPropertyChanged,
(aItem, aProperty, aOldValue, aNewValue));
return NS_OK;
}
NS_IMETHODIMP nsAbManager::NotifyDirectoryItemAdded(nsIAbDirectory *aParentDirectory,
nsISupports *aItem)
@@ -428,17 +428,17 @@ NS_IMETHODIMP nsAbManager::GetUserProfil
nsAutoCString pathBuf;
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(profileDir));
NS_ENSURE_SUCCESS(rv, rv);
return CallQueryInterface(profileDir, userDir);
}
-NS_IMETHODIMP nsAbManager::MailListNameExists(const PRUnichar *name, bool *exist)
+NS_IMETHODIMP nsAbManager::MailListNameExists(const char16_t *name, bool *exist)
{
nsresult rv;
NS_ENSURE_ARG_POINTER(exist);
*exist = false;
// now get the top-level book
nsCOMPtr<nsIAbDirectory> topDirectory;
@@ -1053,38 +1053,38 @@ nsresult nsAbManager::AppendBasicLDIFFor
"objectclass: top" MSG_LINEBREAK \
"objectclass: person" MSG_LINEBREAK \
"objectclass: organizationalPerson" MSG_LINEBREAK \
"objectclass: inetOrgPerson" MSG_LINEBREAK \
"objectclass: " MOZ_AB_OBJECTCLASS MSG_LINEBREAK;
return rv;
}
-bool nsAbManager::IsSafeLDIFString(const PRUnichar *aStr)
+bool nsAbManager::IsSafeLDIFString(const char16_t *aStr)
{
// follow RFC 2849 to determine if something is safe "as is" for LDIF
- if (aStr[0] == PRUnichar(' ') ||
- aStr[0] == PRUnichar(':') ||
- aStr[0] == PRUnichar('<'))
+ if (aStr[0] == char16_t(' ') ||
+ aStr[0] == char16_t(':') ||
+ aStr[0] == char16_t('<'))
return false;
uint32_t i;
uint32_t len = NS_strlen(aStr);
for (i=0; i<len; i++) {
// If string contains CR or LF, it is not safe for LDIF
// and MUST be base64 encoded
- if ((aStr[i] == PRUnichar('\n')) ||
- (aStr[i] == PRUnichar('\r')) ||
+ if ((aStr[i] == char16_t('\n')) ||
+ (aStr[i] == char16_t('\r')) ||
(!NS_IsAscii(aStr[i])))
return false;
}
return true;
}
-nsresult nsAbManager::AppendProperty(const char *aProperty, const PRUnichar *aValue, nsACString &aResult)
+nsresult nsAbManager::AppendProperty(const char *aProperty, const char16_t *aValue, nsACString &aResult)
{
NS_ENSURE_ARG_POINTER(aValue);
aResult += aProperty;
// if the string is not safe "as is", base64 encode it
if (IsSafeLDIFString(aValue)) {
aResult.AppendLiteral(": ");
--- a/mailnews/addrbook/src/nsAbManager.h
+++ b/mailnews/addrbook/src/nsAbManager.h
@@ -35,18 +35,18 @@ public:
private:
nsresult GetRootDirectory(nsIAbDirectory **aResult);
nsresult ExportDirectoryToDelimitedText(nsIAbDirectory *aDirectory, const char *aDelim, uint32_t aDelimLen, nsIFile *aLocalFile);
nsresult ExportDirectoryToLDIF(nsIAbDirectory *aDirectory, nsIFile *aLocalFile);
nsresult AppendLDIFForMailList(nsIAbCard *aCard, nsIAbLDAPAttributeMap *aAttrMap, nsACString &aResult);
nsresult AppendDNForCard(const char *aProperty, nsIAbCard *aCard, nsIAbLDAPAttributeMap *aAttrMap, nsACString &aResult);
nsresult AppendBasicLDIFForCard(nsIAbCard *aCard, nsIAbLDAPAttributeMap *aAttrMap, nsACString &aResult);
- nsresult AppendProperty(const char *aProperty, const PRUnichar *aValue, nsACString &aResult);
- bool IsSafeLDIFString(const PRUnichar *aStr);
+ nsresult AppendProperty(const char *aProperty, const char16_t *aValue, nsACString &aResult);
+ bool IsSafeLDIFString(const char16_t *aStr);
struct abListener {
nsCOMPtr<nsIAbListener> mListener;
uint32_t mNotifyFlags;
abListener(nsIAbListener *aListener, uint32_t aNotifyFlags)
: mListener(aListener), mNotifyFlags(aNotifyFlags) {}
abListener(const abListener &aListener)
--- a/mailnews/addrbook/src/nsAbOSXUtils.mm
+++ b/mailnews/addrbook/src/nsAbOSXUtils.mm
@@ -11,17 +11,17 @@
using namespace mozilla;
#include <AddressBook/AddressBook.h>
#define kABDepartmentProperty (kABDepartmentProperty ? kABDepartmentProperty : @"ABDepartment")
NSString*
WrapString(const nsString &aString)
{
- unichar* chars = reinterpret_cast<unichar*>(const_cast<PRUnichar*>(aString.get()));
+ unichar* chars = reinterpret_cast<unichar*>(const_cast<char16_t*>(aString.get()));
return [NSString stringWithCharacters:chars
length:aString.Length()];
}
void
AppendToString(const NSString *aString, nsString &aResult)
{
--- a/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
@@ -1248,17 +1248,17 @@ nsresult nsAbOutlookDirectory::CreateCar
retCode = ModifyCard(newCard) ;
NS_ENSURE_SUCCESS(retCode, retCode) ;
}
*aNewCard = newCard ;
NS_ADDREF(*aNewCard) ;
return retCode ;
}
-static void UnicodeToWord(const PRUnichar *aUnicode, WORD& aWord)
+static void UnicodeToWord(const char16_t *aUnicode, WORD& aWord)
{
aWord = 0 ;
if (aUnicode == nullptr || *aUnicode == 0) { return ; }
nsresult errorCode = NS_OK;
nsAutoString unichar (aUnicode) ;
aWord = static_cast<WORD>(unichar.ToInteger(&errorCode));
if (NS_FAILED(errorCode)) {
@@ -1417,21 +1417,21 @@ NS_IMETHODIMP nsAbOutlookDirectory::UseF
static void splitString(nsString& aSource, nsString& aTarget)
{
aTarget.Truncate();
int32_t offset = aSource.FindChar('\n');
if (offset >= 0)
{
- const PRUnichar *source = aSource.get() + offset + 1;
+ const char16_t *source = aSource.get() + offset + 1;
while (*source)
{
if (*source == '\n' || *source == '\r')
- aTarget.Append(PRUnichar(' '));
+ aTarget.Append(char16_t(' '));
else
aTarget.Append(*source);
++source;
}
aSource.SetLength(offset);
}
}
--- a/mailnews/addrbook/src/nsAbUtils.h
+++ b/mailnews/addrbook/src/nsAbUtils.h
@@ -70,63 +70,63 @@ private:
{
nsMemory::Free(mArray);
}
}
};
/*
* Wrapper class to automatically free an array of
- * PRUnichar* when class goes out of scope
+ * char16_t* when class goes out of scope
*/
class PRUnicharPtrArrayGuard
{
public:
PRUnicharPtrArrayGuard (bool freeElements = true) :
mFreeElements (freeElements),
mArray (0),
mSize (0)
{
}
~PRUnicharPtrArrayGuard ()
{
Free ();
}
- PRUnichar* operator[](int i)
+ char16_t* operator[](int i)
{
return mArray[i];
}
uint32_t* GetSizeAddr(void)
{
return &mSize;
}
uint32_t GetSize(void)
{
return mSize;
}
- PRUnichar*** GetArrayAddr(void)
+ char16_t*** GetArrayAddr(void)
{
return &mArray;
}
- const PRUnichar** GetArray(void)
+ const char16_t** GetArray(void)
{
- return (const PRUnichar** ) mArray;
+ return (const char16_t** ) mArray;
}
public:
private:
bool mFreeElements;
- PRUnichar **mArray;
+ char16_t **mArray;
uint32_t mSize;
void Free ()
{
if (!mArray)
return;
if (mFreeElements)
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(mSize, mArray);
--- a/mailnews/addrbook/src/nsAbView.cpp
+++ b/mailnews/addrbook/src/nsAbView.cpp
@@ -300,20 +300,20 @@ NS_IMETHODIMP nsAbView::GetRowProperties
NS_IMETHODIMP nsAbView::GetCellProperties(int32_t row, nsITreeColumn* col, nsAString& properties)
{
NS_ENSURE_TRUE(row >= 0, NS_ERROR_UNEXPECTED);
if (mCards.Count() <= row)
return NS_OK;
- const PRUnichar* colID;
+ const char16_t* colID;
col->GetIdConst(&colID);
// "G" == "GeneratedName"
- if (colID[0] != PRUnichar('G'))
+ if (colID[0] != char16_t('G'))
return NS_OK;
nsIAbCard *card = ((AbCard *)(mCards.ElementAt(row)))->card;
bool isMailList;
nsresult rv = card->GetIsMailList(&isMailList);
NS_ENSURE_SUCCESS(rv,rv);
@@ -397,25 +397,25 @@ NS_IMETHODIMP nsAbView::GetProgressMode(
return NS_OK;
}
NS_IMETHODIMP nsAbView::GetCellValue(int32_t row, nsITreeColumn* col, nsAString& _retval)
{
return NS_OK;
}
-nsresult nsAbView::GetCardValue(nsIAbCard *card, const PRUnichar *colID,
+nsresult nsAbView::GetCardValue(nsIAbCard *card, const char16_t *colID,
nsAString &_retval)
{
// "G" == "GeneratedName", "_P" == "_PhoneticName"
// else, standard column (like PrimaryEmail and _AimScreenName)
- if (colID[0] == PRUnichar('G'))
+ if (colID[0] == char16_t('G'))
return card->GenerateName(mGeneratedNameFormat, mABBundle, _retval);
- if (colID[0] == PRUnichar('_') && colID[1] == PRUnichar('P'))
+ if (colID[0] == char16_t('_') && colID[1] == char16_t('P'))
// Use LN/FN order for the phonetic name
return card->GeneratePhoneticName(true, _retval);
if (!NS_strcmp(colID, MOZ_UTF16("ChatName")))
return card->GenerateChatName(_retval);
nsresult rv = card->GetPropertyAsAString(NS_ConvertUTF16toUTF8(colID).get(), _retval);
if (rv == NS_ERROR_NOT_AVAILABLE) {
@@ -462,17 +462,17 @@ nsresult nsAbView::RefreshTree()
return rv;
}
NS_IMETHODIMP nsAbView::GetCellText(int32_t row, nsITreeColumn* col, nsAString& _retval)
{
NS_ENSURE_TRUE(row >= 0 && row < mCards.Count(), NS_ERROR_UNEXPECTED);
nsIAbCard *card = ((AbCard *)(mCards.ElementAt(row)))->card;
- const PRUnichar* colID;
+ const char16_t* colID;
col->GetIdConst(&colID);
return GetCardValue(card, colID, _retval);
}
NS_IMETHODIMP nsAbView::SetTree(nsITreeBoxObject *tree)
{
mTree = tree;
return NS_OK;
@@ -528,27 +528,27 @@ NS_IMETHODIMP nsAbView::SetCellValue(int
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsAbView::SetCellText(int32_t row, nsITreeColumn* col, const nsAString& value)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
-NS_IMETHODIMP nsAbView::PerformAction(const PRUnichar *action)
+NS_IMETHODIMP nsAbView::PerformAction(const char16_t *action)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
-NS_IMETHODIMP nsAbView::PerformActionOnRow(const PRUnichar *action, int32_t row)
+NS_IMETHODIMP nsAbView::PerformActionOnRow(const char16_t *action, int32_t row)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
-NS_IMETHODIMP nsAbView::PerformActionOnCell(const PRUnichar *action, int32_t row, nsITreeColumn* col)
+NS_IMETHODIMP nsAbView::PerformActionOnCell(const char16_t *action, int32_t row, nsITreeColumn* col)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsAbView::GetCardFromRow(int32_t row, nsIAbCard **aCard)
{
*aCard = nullptr;
if (mCards.Count() <= row) {
@@ -565,17 +565,17 @@ NS_IMETHODIMP nsAbView::GetCardFromRow(i
return NS_OK;
}
#define DESCENDING_SORT_FACTOR -1
#define ASCENDING_SORT_FACTOR 1
typedef struct SortClosure
{
- const PRUnichar *colID;
+ const char16_t *colID;
int32_t factor;
nsAbView *abView;
} SortClosure;
static int
inplaceSortCallback(const void *data1, const void *data2, void *privateData)
{
AbCard *card1 = (AbCard *)data1;
@@ -584,46 +584,46 @@ inplaceSortCallback(const void *data1, c
SortClosure *closure = (SortClosure *) privateData;
int32_t sortValue;
// If we are sorting the "PrimaryEmail", swap the collation keys, as the secondary is always the
// PrimaryEmail. Use the last primary key as the secondary key.
//
// "Pr" to distinguish "PrimaryEmail" from "PagerNumber"
- if (closure->colID[0] == PRUnichar('P') && closure->colID[1] == PRUnichar('r')) {
+ if (closure->colID[0] == char16_t('P') && closure->colID[1] == char16_t('r')) {
sortValue = closure->abView->CompareCollationKeys(card1->secondaryCollationKey,card1->secondaryCollationKeyLen,card2->secondaryCollationKey,card2->secondaryCollationKeyLen);
if (sortValue)
return sortValue * closure->factor;
else
return closure->abView->CompareCollationKeys(card1->primaryCollationKey,card1->primaryCollationKeyLen,card2->primaryCollationKey,card2->primaryCollationKeyLen) * (closure->factor);
}
else {
sortValue = closure->abView->CompareCollationKeys(card1->primaryCollationKey,card1->primaryCollationKeyLen,card2->primaryCollationKey,card2->primaryCollationKeyLen);
if (sortValue)
return sortValue * (closure->factor);
else
return closure->abView->CompareCollationKeys(card1->secondaryCollationKey,card1->secondaryCollationKeyLen,card2->secondaryCollationKey,card2->secondaryCollationKeyLen) * (closure->factor);
}
}
-static void SetSortClosure(const PRUnichar *sortColumn, const PRUnichar *sortDirection, nsAbView *abView, SortClosure *closure)
+static void SetSortClosure(const char16_t *sortColumn, const char16_t *sortDirection, nsAbView *abView, SortClosure *closure)
{
closure->colID = sortColumn;
if (sortDirection && !NS_strcmp(sortDirection, MOZ_UTF16("descending")))
closure->factor = DESCENDING_SORT_FACTOR;
else
closure->factor = ASCENDING_SORT_FACTOR;
closure->abView = abView;
return;
}
-NS_IMETHODIMP nsAbView::SortBy(const PRUnichar *colID, const PRUnichar *sortDir)
+NS_IMETHODIMP nsAbView::SortBy(const char16_t *colID, const char16_t *sortDir)
{
nsresult rv;
int32_t count = mCards.Count();
nsAutoString sortColumn;
if (!colID)
sortColumn = NS_LITERAL_STRING(GENERATED_NAME_COLUMN_ID).get(); // default sort
@@ -715,17 +715,17 @@ int32_t nsAbView::CompareCollationKeys(u
nsresult rv = mCollationKeyGenerator->CompareRawSortKey(key1,len1,key2,len2,&result);
NS_ASSERTION(NS_SUCCEEDED(rv), "key compare failed");
if (NS_FAILED(rv))
result = 0;
return result;
}
-nsresult nsAbView::GenerateCollationKeysForCard(const PRUnichar *colID, AbCard *abcard)
+nsresult nsAbView::GenerateCollationKeysForCard(const char16_t *colID, AbCard *abcard)
{
nsresult rv;
nsString value;
if (!mCollationKeyGenerator)
{
nsCOMPtr<nsILocaleService> localeSvc = do_GetService(NS_LOCALESERVICE_CONTRACTID,&rv);
NS_ENSURE_SUCCESS(rv, rv);
@@ -785,17 +785,17 @@ NS_IMETHODIMP nsAbView::OnItemAdded(nsIS
int32_t index;
rv = AddCard(abcard, false /* select card */, &index);
NS_ENSURE_SUCCESS(rv,rv);
}
}
return rv;
}
-NS_IMETHODIMP nsAbView::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
+NS_IMETHODIMP nsAbView::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData)
{
if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
if (nsDependentString(someData).EqualsLiteral(PREF_MAIL_ADDR_BOOK_LASTNAMEFIRST)) {
nsresult rv = SetGeneratedNameFormatFromPrefs();
NS_ENSURE_SUCCESS(rv, rv);
rv = RefreshTree();
NS_ENSURE_SUCCESS(rv, rv);
@@ -934,17 +934,17 @@ int32_t nsAbView::FindIndexForCard(nsIAb
nsresult rv = card->Equals(abcard->card, &equals);
if (NS_SUCCEEDED(rv) && equals) {
return i;
}
}
return CARD_NOT_FOUND;
}
-NS_IMETHODIMP nsAbView::OnItemPropertyChanged(nsISupports *item, const char *property, const PRUnichar *oldValue, const PRUnichar *newValue)
+NS_IMETHODIMP nsAbView::OnItemPropertyChanged(nsISupports *item, const char *property, const char16_t *oldValue, const char16_t *newValue)
{
nsresult rv;
nsCOMPtr <nsIAbCard> card = do_QueryInterface(item);
if (!card)
return NS_OK;
int32_t index = FindIndexForCard(card);
@@ -1200,18 +1200,18 @@ NS_IMETHODIMP nsAbView::SwapFirstNameLas
abCard->SetLastName(fn);
// Generate display name using the new order
if (displayNameAutoGeneration &&
!fn.IsEmpty() && !ln.IsEmpty())
{
nsString dnLnFn;
nsString dnFnLn;
- const PRUnichar *nameString[2];
- const PRUnichar *formatString;
+ const char16_t *nameString[2];
+ const char16_t *formatString;
// The format should stays the same before/after we swap the names
formatString = displayNameLastnamefirst ?
MOZ_UTF16("lastFirstFormat") :
MOZ_UTF16("firstLastFormat");
// Generate both ln/fn and fn/ln combination since we need both later
// to check to see if the current display name was edited
--- a/mailnews/addrbook/src/nsAbView.h
+++ b/mailnews/addrbook/src/nsAbView.h
@@ -46,26 +46,26 @@ public:
NS_DECL_NSIOBSERVER
int32_t CompareCollationKeys(uint8_t *key1, uint32_t len1, uint8_t *key2, uint32_t len2);
private:
nsresult Initialize();
int32_t FindIndexForInsert(AbCard *abcard);
int32_t FindIndexForCard(nsIAbCard *card);
- nsresult GenerateCollationKeysForCard(const PRUnichar *colID, AbCard *abcard);
+ nsresult GenerateCollationKeysForCard(const char16_t *colID, AbCard *abcard);
nsresult InvalidateTree(int32_t row);
nsresult RemoveCardAt(int32_t row);
nsresult AddCard(AbCard *abcard, bool selectCardAfterAdding, int32_t *index);
nsresult RemoveCardAndSelectNextCard(nsISupports *item);
nsresult EnumerateCards();
nsresult SetGeneratedNameFormatFromPrefs();
nsresult GetSelectedCards(nsCOMPtr<nsIMutableArray> &aSelectedCards);
nsresult ReselectCards(nsIArray *aCards, nsIAbCard *aIndexCard);
- nsresult GetCardValue(nsIAbCard *card, const PRUnichar *colID, nsAString &_retval);
+ nsresult GetCardValue(nsIAbCard *card, const char16_t *colID, nsAString &_retval);
nsresult RefreshTree();
nsCOMPtr<nsITreeBoxObject> mTree;
nsCOMPtr<nsITreeSelection> mTreeSelection;
nsCOMPtr <nsIAbDirectory> mDirectory;
nsVoidArray mCards;
nsString mSortColumn;
nsString mSortDirection;
--- a/mailnews/addrbook/src/nsAbWinHelper.cpp
+++ b/mailnews/addrbook/src/nsAbWinHelper.cpp
@@ -505,17 +505,17 @@ BOOL nsAbWinHelper::DeleteEntry(const ns
if (HR_FAILED(mLastError)) {
PRINTF(("Cannot delete entry %08x.\n", mLastError)) ;
return FALSE ;
}
return TRUE ;
}
BOOL nsAbWinHelper::SetPropertyUString(const nsMapiEntry& aObject, ULONG aPropertyTag,
- const PRUnichar *aValue)
+ const char16_t *aValue)
{
SPropValue value ;
nsAutoCString alternativeValue ;
value.ulPropTag = aPropertyTag ;
if (PROP_TYPE(aPropertyTag) == PT_UNICODE) {
value.Value.lpszW = const_cast<WCHAR *>(aValue) ;
}
--- a/mailnews/addrbook/src/nsAbWinHelper.h
+++ b/mailnews/addrbook/src/nsAbWinHelper.h
@@ -71,17 +71,17 @@ public:
// Get the value of a MAPI property of type BIN
BOOL GetPropertyBin(const nsMapiEntry& aObject, ULONG aPropertyTag, nsMapiEntry& aValue) ;
// Tests if a container contains an entry
BOOL TestOpenEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
// Delete an entry in the address book
BOOL DeleteEntry(const nsMapiEntry& aContainer, const nsMapiEntry& aEntry) ;
// Set the value of a MAPI property of type string in unicode
BOOL SetPropertyUString (const nsMapiEntry& aObject, ULONG aPropertyTag,
- const PRUnichar *aValue) ;
+ const char16_t *aValue) ;
// Same as previous, but with a bunch of properties in one call
BOOL SetPropertiesUString(const nsMapiEntry& aObject, const ULONG *aPropertiesTag,
ULONG aNbProperties, nsString *aValues) ;
// Set the value of a MAPI property of type SYSTIME
BOOL SetPropertyDate(const nsMapiEntry& aObject, ULONG aPropertyTag,
WORD aYear, WORD aMonth, WORD aDay) ;
// Create entry in the address book
BOOL CreateEntry(const nsMapiEntry& aParent, nsMapiEntry& aNewEntry) ;
--- a/mailnews/addrbook/src/nsAddrDatabase.cpp
+++ b/mailnews/addrbook/src/nsAddrDatabase.cpp
@@ -397,17 +397,17 @@ NS_IMETHODIMP nsAddrDatabase::Open
(void)AlertAboutCorruptMabFile(originalMabFileName.get(),
NS_ConvertASCIItoUTF16(backupMabFileName).get());
}
}
}
return rv;
}
-nsresult nsAddrDatabase::DisplayAlert(const PRUnichar *titleName, const PRUnichar *alertStringName, const PRUnichar **formatStrings, int32_t numFormatStrings)
+nsresult nsAddrDatabase::DisplayAlert(const char16_t *titleName, const char16_t *alertStringName, const char16_t **formatStrings, int32_t numFormatStrings)
{
nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://messenger/locale/addressbook/addressBook.properties", getter_AddRefs(bundle));
@@ -424,26 +424,26 @@ nsresult nsAddrDatabase::DisplayAlert(co
nsCOMPtr<nsIPromptService> prompter =
do_GetService(NS_PROMPTSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
return prompter->Alert(nullptr /* we don't know the parent window */, alertTitle.get(), alertMessage.get());
}
-nsresult nsAddrDatabase::AlertAboutCorruptMabFile(const PRUnichar *aOldFileName, const PRUnichar *aNewFileName)
+nsresult nsAddrDatabase::AlertAboutCorruptMabFile(const char16_t *aOldFileName, const char16_t *aNewFileName)
{
- const PRUnichar *formatStrings[] = { aOldFileName, aOldFileName, aNewFileName };
+ const char16_t *formatStrings[] = { aOldFileName, aOldFileName, aNewFileName };
return DisplayAlert(MOZ_UTF16("corruptMabFileTitle"),
MOZ_UTF16("corruptMabFileAlert"), formatStrings, 3);
}
-nsresult nsAddrDatabase::AlertAboutLockedMabFile(const PRUnichar *aFileName)
+nsresult nsAddrDatabase::AlertAboutLockedMabFile(const char16_t *aFileName)
{
- const PRUnichar *formatStrings[] = { aFileName };
+ const char16_t *formatStrings[] = { aFileName };
return DisplayAlert(MOZ_UTF16("lockedMabFileTitle"),
MOZ_UTF16("lockedMabFileAlert"), formatStrings, 1);
}
nsresult
nsAddrDatabase::OpenInternal(nsIFile *aMabFile, bool aCreate, nsIAddrDatabase** pAddrDB)
{
nsAddrDatabase *pAddressBookDB = new nsAddrDatabase();
@@ -1008,17 +1008,17 @@ nsresult nsAddrDatabase::ConvertAndAddLo
if (!colString.IsEmpty())
{
rv = AddLowercaseColumn(row, toCol, NS_ConvertUTF16toUTF8(colString).get());
}
return rv;
}
// Change the unicode string to lowercase, then convert to UTF8 string to store in db
-nsresult nsAddrDatabase::AddUnicodeToColumn(nsIMdbRow * row, mdb_token aColToken, mdb_token aLowerCaseColToken, const PRUnichar* aUnicodeStr)
+nsresult nsAddrDatabase::AddUnicodeToColumn(nsIMdbRow * row, mdb_token aColToken, mdb_token aLowerCaseColToken, const char16_t* aUnicodeStr)
{
nsresult rv = AddCharStringColumn(row, aColToken, NS_ConvertUTF16toUTF8(aUnicodeStr).get());
NS_ENSURE_SUCCESS(rv,rv);
rv = AddLowercaseColumn(row, aLowerCaseColToken, NS_ConvertUTF16toUTF8(aUnicodeStr).get());
NS_ENSURE_SUCCESS(rv,rv);
return rv;
}
@@ -1716,17 +1716,17 @@ NS_IMETHODIMP nsAddrDatabase::DeleteCard
err = DeleteCardFromListRow(pListRow, cardRowID);
if (NS_SUCCEEDED(err) && aNotify) {
NotifyCardEntryChange(AB_NotifyDeleted, card, mailList);
}
NS_RELEASE(pListRow);
return NS_OK;
}
-NS_IMETHODIMP nsAddrDatabase::SetCardValue(nsIAbCard *card, const char *name, const PRUnichar *value, bool notify)
+NS_IMETHODIMP nsAddrDatabase::SetCardValue(nsIAbCard *card, const char *name, const char16_t *value, bool notify)
{
NS_ENSURE_ARG_POINTER(card);
NS_ENSURE_ARG_POINTER(name);
NS_ENSURE_ARG_POINTER(value);
if (!m_mdbStore || !m_mdbEnv)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
@@ -1747,17 +1747,17 @@ NS_IMETHODIMP nsAddrDatabase::SetCardVal
mdb_token token;
rv = m_mdbStore->StringToToken(m_mdbEnv, name, &token);
NS_ENSURE_SUCCESS(rv, rv);
return AddCharStringColumn(cardRow, token, NS_ConvertUTF16toUTF8(value).get());
}
-NS_IMETHODIMP nsAddrDatabase::GetCardValue(nsIAbCard *card, const char *name, PRUnichar **value)
+NS_IMETHODIMP nsAddrDatabase::GetCardValue(nsIAbCard *card, const char *name, char16_t **value)
{
if (!m_mdbStore || !card || !name || !value || !m_mdbEnv)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
nsCOMPtr <nsIMdbRow> cardRow;
mdbOid rowOid;
@@ -3145,17 +3145,17 @@ NS_IMETHODIMP nsAddrDatabase::AddListDir
if(NS_SUCCEEDED(rv))
dbparentDir->NotifyDirItemAdded(mailList);
}
}
}
return rv;
}
-NS_IMETHODIMP nsAddrDatabase::FindMailListbyUnicodeName(const PRUnichar *listName, bool *exist)
+NS_IMETHODIMP nsAddrDatabase::FindMailListbyUnicodeName(const char16_t *listName, bool *exist)
{
nsAutoString unicodeString(listName);
ToLowerCase(unicodeString);
nsCOMPtr <nsIMdbRow> listRow;
nsresult rv = GetRowForCharColumn(unicodeString.get(),
m_LowerListNameColumnToken, false,
false, getter_AddRefs(listRow), nullptr);
@@ -3170,17 +3170,17 @@ NS_IMETHODIMP nsAddrDatabase::GetCardCou
rv = m_mdbPabTable->GetCount(m_mdbEnv, &c);
if (NS_SUCCEEDED(rv))
*count = c - 1; // Don't count LastRecordKey
return rv;
}
bool
-nsAddrDatabase::HasRowButDeletedForCharColumn(const PRUnichar *unicodeStr, mdb_column findColumn, bool aIsCard, nsIMdbRow **aFindRow)
+nsAddrDatabase::HasRowButDeletedForCharColumn(const char16_t *unicodeStr, mdb_column findColumn, bool aIsCard, nsIMdbRow **aFindRow)
{
if (!m_mdbStore || !aFindRow || !m_mdbEnv)
return false;
mdbYarn sourceYarn;
NS_ConvertUTF16toUTF8 UTF8String(unicodeStr);
sourceYarn.mYarn_Buf = (void *) UTF8String.get();
@@ -3220,17 +3220,17 @@ nsAddrDatabase::HasRowButDeletedForCharC
return (NS_SUCCEEDED(rv) && *aFindRow);
}
/* @param aRowPos Contains the row position for multiple calls. Should be
* instantiated to -1 on the first call. Or can be null
* if you are not making multiple calls.
*/
nsresult
-nsAddrDatabase::GetRowForCharColumn(const PRUnichar *unicodeStr,
+nsAddrDatabase::GetRowForCharColumn(const char16_t *unicodeStr,
mdb_column findColumn, bool aIsCard,
bool aCaseInsensitive,
nsIMdbRow **aFindRow,
mdb_pos *aRowPos)
{
NS_ENSURE_ARG_POINTER(unicodeStr);
NS_ENSURE_ARG_POINTER(aFindRow);
NS_ENSURE_TRUE(m_mdbEnv && m_mdbPabTable, NS_ERROR_NULL_POINTER);
--- a/mailnews/addrbook/src/nsAddrDatabase.h
+++ b/mailnews/addrbook/src/nsAddrDatabase.h
@@ -237,22 +237,22 @@ public:
{ return AddCharStringColumn(row, m_ListNickNameColumnToken, value); }
NS_IMETHOD AddListDescription(nsIMdbRow * row, const char * value) MOZ_OVERRIDE
{ return AddCharStringColumn(row, m_ListDescriptionColumnToken, value); }
NS_IMETHOD AddListDirNode(nsIMdbRow * listRow) MOZ_OVERRIDE;
- NS_IMETHOD FindMailListbyUnicodeName(const PRUnichar *listName, bool *exist) MOZ_OVERRIDE;
+ NS_IMETHOD FindMailListbyUnicodeName(const char16_t *listName, bool *exist) MOZ_OVERRIDE;
NS_IMETHOD GetCardCount(uint32_t *count) MOZ_OVERRIDE;
- NS_IMETHOD SetCardValue(nsIAbCard *card, const char *name, const PRUnichar *value, bool notify) MOZ_OVERRIDE;
- NS_IMETHOD GetCardValue(nsIAbCard *card, const char *name, PRUnichar **value) MOZ_OVERRIDE;
+ NS_IMETHOD SetCardValue(nsIAbCard *card, const char *name, const char16_t *value, bool notify) MOZ_OVERRIDE;
+ NS_IMETHOD GetCardValue(nsIAbCard *card, const char *name, char16_t **value) MOZ_OVERRIDE;
// nsAddrDatabase methods:
nsAddrDatabase();
virtual ~nsAddrDatabase();
void GetMDBFactory(nsIMdbFactory ** aMdbFactory);
nsIMdbEnv *GetEnv() {return m_mdbEnv;}
uint32_t GetCurVersion();
@@ -328,17 +328,17 @@ protected:
nsresult InitLastRecorKey();
nsresult GetDataRow(nsIMdbRow **pDataRow);
nsresult GetLastRecordKey();
nsresult UpdateLastRecordKey();
nsresult CheckAndUpdateRecordKey();
nsresult UpdateLowercaseEmailListName();
nsresult ConvertAndAddLowercaseColumn(nsIMdbRow * row, mdb_token fromCol, mdb_token toCol);
- nsresult AddUnicodeToColumn(nsIMdbRow * row, mdb_token colToken, mdb_token lowerCaseColToken, const PRUnichar* pUnicodeStr);
+ nsresult AddUnicodeToColumn(nsIMdbRow * row, mdb_token colToken, mdb_token lowerCaseColToken, const char16_t* pUnicodeStr);
nsresult DeleteRow(nsIMdbTable* dbTable, nsIMdbRow* dbRow);
nsIMdbEnv *m_mdbEnv; // to be used in all the db calls.
nsIMdbStore *m_mdbStore;
nsIMdbTable *m_mdbPabTable;
nsIMdbTable *m_mdbDeletedCardsTable;
nsCOMPtr<nsIFile> m_dbName;
@@ -423,21 +423,21 @@ protected:
mdb_token m_ListTotalColumnToken;
mdb_token m_LowerListNameColumnToken;
uint32_t m_LastRecordKey;
nsWeakPtr m_dbDirectory;
nsCOMPtr<nsIMdbFactory> mMdbFactory;
private:
- nsresult GetRowForCharColumn(const PRUnichar *unicodeStr,
+ nsresult GetRowForCharColumn(const char16_t *unicodeStr,
mdb_column findColumn, bool bIsCard,
bool aCaseInsensitive, nsIMdbRow **findRow,
mdb_pos *aRowPos);
- bool HasRowButDeletedForCharColumn(const PRUnichar *unicodeStr, mdb_column findColumn, bool aIsCard, nsIMdbRow **aFindRow);
+ bool HasRowButDeletedForCharColumn(const char16_t *unicodeStr, mdb_column findColumn, bool aIsCard, nsIMdbRow **aFindRow);
nsresult OpenInternal(nsIFile *aMabFile, bool aCreate, nsIAddrDatabase **pCardDB);
- nsresult AlertAboutCorruptMabFile(const PRUnichar *aOldFileName, const PRUnichar *aNewFileName);
- nsresult AlertAboutLockedMabFile(const PRUnichar *aFileName);
- nsresult DisplayAlert(const PRUnichar *titleName, const PRUnichar *alertStringName,
- const PRUnichar **formatStrings, int32_t numFormatStrings);
+ nsresult AlertAboutCorruptMabFile(const char16_t *aOldFileName, const char16_t *aNewFileName);
+ nsresult AlertAboutLockedMabFile(const char16_t *aFileName);
+ nsresult DisplayAlert(const char16_t *titleName, const char16_t *alertStringName,
+ const char16_t **formatStrings, int32_t numFormatStrings);
};
#endif
--- a/mailnews/addrbook/src/nsDirPrefs.cpp
+++ b/mailnews/addrbook/src/nsDirPrefs.cpp
@@ -78,17 +78,17 @@ class DirPrefObserver : public nsSupport
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
};
NS_IMPL_ISUPPORTS2(DirPrefObserver, nsISupportsWeakReference, nsIObserver)
-NS_IMETHODIMP DirPrefObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
+NS_IMETHODIMP DirPrefObserver::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
{
nsCOMPtr<nsIPrefBranch> prefBranch(do_QueryInterface(aSubject));
nsCString strPrefName;
strPrefName.Assign(NS_ConvertUTF16toUTF8(aData));
const char *prefname = strPrefName.get();
DIR_PrefId id = DIR_AtomizePrefName(prefname);
--- a/mailnews/base/search/public/nsMsgSearchAdapter.h
+++ b/mailnews/base/search/public/nsMsgSearchAdapter.h
@@ -39,26 +39,26 @@ public:
nsCOMPtr<nsISupportsArray> m_searchTerms; /* linked list of criteria terms */
bool m_abortCalled;
nsString m_defaultCharset;
bool m_forceAsciiSearch;
static nsresult EncodeImap (char **ppEncoding,
nsISupportsArray *searchTerms,
- const PRUnichar *srcCharset,
- const PRUnichar *destCharset,
+ const char16_t *srcCharset,
+ const char16_t *destCharset,
bool reallyDredd = false);
static nsresult EncodeImapValue(char *encoding, const char *value, bool useQuotes, bool reallyDredd);
- static char *GetImapCharsetParam(const PRUnichar *destCharset);
- static PRUnichar *EscapeSearchUrl (const PRUnichar *nntpCommand);
- static PRUnichar *EscapeImapSearchProtocol(const PRUnichar *imapCommand);
- static PRUnichar *EscapeQuoteImapSearchProtocol(const PRUnichar *imapCommand);
+ static char *GetImapCharsetParam(const char16_t *destCharset);
+ static char16_t *EscapeSearchUrl (const char16_t *nntpCommand);
+ static char16_t *EscapeImapSearchProtocol(const char16_t *imapCommand);
+ static char16_t *EscapeQuoteImapSearchProtocol(const char16_t *imapCommand);
static char *UnEscapeSearchUrl (const char *commandSpecificData);
// This stuff lives in the base class because the IMAP search syntax
// is used by the Dredd SEARCH command as well as IMAP itself
static const char *m_kImapBefore;
static const char *m_kImapBody;
static const char *m_kImapCC;
static const char *m_kImapFrom;
static const char *m_kImapNot;
@@ -89,17 +89,17 @@ protected:
kOverwrite, /* "John Doe" -> "John*Doe", simple contains */
kInsert, /* "John Doe" -> "John* Doe", name completion */
kSurround /* "John Doe" -> "John* *Doe", advanced contains */
} msg_TransformType;
char *TransformSpacesToStars (const char *, msg_TransformType transformType);
nsresult OpenNewsResultInUnknownGroup (nsMsgResultElement*);
- static nsresult EncodeImapTerm (nsIMsgSearchTerm *, bool reallyDredd, const PRUnichar *srcCharset, const PRUnichar *destCharset, char **ppOutTerm);
+ static nsresult EncodeImapTerm (nsIMsgSearchTerm *, bool reallyDredd, const char16_t *srcCharset, const char16_t *destCharset, char **ppOutTerm);
};
//-----------------------------------------------------------------------------
// Validity checking for attrib/op pairs. We need to know what operations are
// legal in three places:
// 1. when the FE brings up the dialog box and needs to know how to build
// the menus and enable their items
// 2. when the FE fires off a search, we need to check their lists for
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -528,17 +528,17 @@ NS_IMETHODIMP nsMsgFilter::LogRuleHit(ns
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
- const PRUnichar *filterLogDetectFormatStrings[4] = { filterName.get(), authorValue.get(), subjectValue.get(), dateValue.get() };
+ const char16_t *filterLogDetectFormatStrings[4] = { filterName.get(), authorValue.get(), subjectValue.get(), dateValue.get() };
nsString filterLogDetectStr;
rv = bundle->FormatStringFromName(
MOZ_UTF16("filterLogDetectStr"),
filterLogDetectFormatStrings, 4,
getter_Copies(filterLogDetectStr));
NS_ENSURE_SUCCESS(rv, rv);
buffer += NS_ConvertUTF16toUTF8(filterLogDetectStr);
@@ -550,17 +550,17 @@ NS_IMETHODIMP nsMsgFilter::LogRuleHit(ns
nsCString actionFolderUri;
aFilterAction->GetTargetFolderUri(actionFolderUri);
NS_ConvertASCIItoUTF16 actionFolderUriValue(actionFolderUri);
nsCString msgId;
aMsgHdr->GetMessageId(getter_Copies(msgId));
NS_ConvertASCIItoUTF16 msgIdValue(msgId);
- const PRUnichar *logMoveFormatStrings[2] = { msgIdValue.get(), actionFolderUriValue.get() };
+ const char16_t *logMoveFormatStrings[2] = { msgIdValue.get(), actionFolderUriValue.get() };
nsString logMoveStr;
rv = bundle->FormatStringFromName(
(actionType == nsMsgFilterAction::MoveToFolder) ?
MOZ_UTF16("logMoveStr") : MOZ_UTF16("logCopyStr"),
logMoveFormatStrings, 2,
getter_Copies(logMoveStr));
NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/search/src/nsMsgFilterList.cpp
+++ b/mailnews/base/search/src/nsMsgFilterList.cpp
@@ -20,20 +20,20 @@
#include "nsISupportsObsolete.h"
#include "nsNetUtil.h"
#include "nsMsgI18N.h"
#include "nsMemory.h"
#include "prmem.h"
#include <ctype.h>
// unicode "%s" format string
-static const PRUnichar unicodeFormatter[] = {
- (PRUnichar)'%',
- (PRUnichar)'s',
- (PRUnichar)0,
+static const char16_t unicodeFormatter[] = {
+ (char16_t)'%',
+ (char16_t)'s',
+ (char16_t)0,
};
nsMsgFilterList::nsMsgFilterList() :
m_fileVersion(0)
{
m_loggingEnabled = false;
m_startWritingToBuffer = false;
@@ -571,17 +571,17 @@ nsresult nsMsgFilterList::LoadTextFilter
if (NS_FAILED(err))
break;
filter->SetFilterName(unicodeStr);
}
else
{
// ### fix me - this is silly.
- PRUnichar *unicodeString =
+ char16_t *unicodeString =
nsTextFormatter::smprintf(unicodeFormatter, value.get());
filter->SetFilterName(nsDependentString(unicodeString));
nsTextFormatter::smprintf_free(unicodeString);
}
m_curFilter = filter;
m_filters.AppendElement(filter);
}
break;
@@ -855,17 +855,17 @@ nsMsgFilterList::WriteStrAttr(nsMsgFilte
nsresult nsMsgFilterList::WriteBoolAttr(nsMsgFilterFileAttribValue attrib, bool boolVal, nsIOutputStream *aStream)
{
return WriteStrAttr(attrib, (boolVal) ? "yes" : "no", aStream);
}
nsresult
nsMsgFilterList::WriteWstrAttr(nsMsgFilterFileAttribValue attrib,
- const PRUnichar *aFilterName, nsIOutputStream *aStream)
+ const char16_t *aFilterName, nsIOutputStream *aStream)
{
WriteStrAttr(attrib, NS_ConvertUTF16toUTF8(aFilterName).get(), aStream);
return NS_OK;
}
nsresult nsMsgFilterList::SaveTextFilters(nsIOutputStream *aStream)
{
uint32_t filterCount = 0;
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -171,17 +171,17 @@ nsresult nsMsgFilterService::BackUpFilte
}
nsresult nsMsgFilterService::AlertBackingUpFilterFile(nsIMsgWindow *aMsgWindow)
{
return ThrowAlertMsg("filterListBackUpMsg", aMsgWindow);
}
nsresult //Do not use this routine if you have to call it very often because it creates a new bundle each time
-nsMsgFilterService::GetStringFromBundle(const char *aMsgName, PRUnichar **aResult)
+nsMsgFilterService::GetStringFromBundle(const char *aMsgName, char16_t **aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
nsCOMPtr <nsIStringBundle> bundle;
nsresult rv = GetFilterStringBundle(getter_AddRefs(bundle));
if (NS_SUCCEEDED(rv) && bundle)
rv = bundle->GetStringFromName(NS_ConvertASCIItoUTF16(aMsgName).get(), aResult);
return rv;
@@ -252,17 +252,17 @@ public:
NS_DECL_NSIMSGCOPYSERVICELISTENER
nsresult AdvanceToNextFolder(); // kicks off the process
protected:
virtual nsresult RunNextFilter();
nsresult ApplyFilter(bool *aApplyMore = nullptr);
nsresult OnEndExecution(nsresult executionStatus); // do what we have to do to cleanup.
bool ContinueExecutionPrompt();
- nsresult DisplayConfirmationPrompt(nsIMsgWindow *msgWindow, const PRUnichar *confirmString, bool *confirmed);
+ nsresult DisplayConfirmationPrompt(nsIMsgWindow *msgWindow, const char16_t *confirmString, bool *confirmed);
nsCOMPtr<nsIMsgWindow> m_msgWindow;
nsCOMPtr<nsIMsgFilterList> m_filters;
nsCOMPtr<nsIArray> m_folders;
nsCOMPtr<nsIMsgFolder> m_curFolder;
nsCOMPtr<nsIMsgDatabase> m_curFolderDB;
nsCOMPtr<nsIMsgFilter> m_curFilter;
uint32_t m_curFilterIndex;
uint32_t m_curFolderIndex;
@@ -1050,31 +1050,31 @@ bool nsMsgFilterAfterTheFact::ContinueEx
bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
getter_AddRefs(bundle));
if (!bundle)
return false;
nsString filterName;
m_curFilter->GetFilterName(filterName);
nsString formatString;
nsString confirmText;
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
filterName.get()
};
nsresult rv = bundle->FormatStringFromName(MOZ_UTF16("continueFilterExecution"),
formatStrings, 1, getter_Copies(confirmText));
if (NS_FAILED(rv))
return false;
bool returnVal = false;
(void) DisplayConfirmationPrompt(m_msgWindow, confirmText.get(), &returnVal);
return returnVal;
}
nsresult
-nsMsgFilterAfterTheFact::DisplayConfirmationPrompt(nsIMsgWindow *msgWindow, const PRUnichar *confirmString, bool *confirmed)
+nsMsgFilterAfterTheFact::DisplayConfirmationPrompt(nsIMsgWindow *msgWindow, const char16_t *confirmString, bool *confirmed)
{
if (msgWindow)
{
nsCOMPtr <nsIDocShell> docShell;
msgWindow->GetRootDocShell(getter_AddRefs(docShell));
if (docShell)
{
nsCOMPtr<nsIPrompt> dialog(do_GetInterface(docShell));
--- a/mailnews/base/search/src/nsMsgFilterService.h
+++ b/mailnews/base/search/src/nsMsgFilterService.h
@@ -27,17 +27,17 @@ public:
NS_DECL_NSIMSGFILTERSERVICE
/* clients call OpenFilterList to get a handle to a FilterList, of existing nsMsgFilter *.
These are manipulated by the front end as a result of user interaction
with dialog boxes. To apply the new list call MSG_CloseFilterList.
*/
nsresult BackUpFilterFile(nsIFile *aFilterFile, nsIMsgWindow *aMsgWindow);
nsresult AlertBackingUpFilterFile(nsIMsgWindow *aMsgWindow);
nsresult ThrowAlertMsg(const char*aMsgName, nsIMsgWindow *aMsgWindow);
- nsresult GetStringFromBundle(const char *aMsgName, PRUnichar **aResult);
+ nsresult GetStringFromBundle(const char *aMsgName, char16_t **aResult);
nsresult GetFilterStringBundle(nsIStringBundle **aBundle);
protected:
nsCOMArray<nsIMsgFilterCustomAction> mCustomActions; // defined custom action list
nsCOMArray<nsIMsgSearchCustomTerm> mCustomTerms; // defined custom term list
};
--- a/mailnews/base/search/src/nsMsgImapSearch.cpp
+++ b/mailnews/base/search/src/nsMsgImapSearch.cpp
@@ -72,17 +72,17 @@ nsresult nsMsgSearchOnlineMail::Search (
// folder. We might for an offline IMAP folder.
nsresult err = NS_ERROR_NOT_IMPLEMENTED;
return err;
}
nsresult nsMsgSearchOnlineMail::Encode (nsCString& pEncoding,
nsISupportsArray *searchTerms,
- const PRUnichar *destCharset)
+ const char16_t *destCharset)
{
nsCString imapTerms;
//check if searchTerms are ascii only
bool asciiOnly = true;
// ### what's this mean in the NWO?????
if (true) // !(srcCharset & CODESET_MASK == STATEFUL || srcCharset & CODESET_MASK == WIDECHAR) ) //assume all single/multiple bytes charset has ascii as subset
--- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp
+++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp
@@ -144,58 +144,58 @@ NS_IMETHODIMP nsMsgSearchAdapter::AddRes
NS_IMETHODIMP nsMsgSearchAdapter::AddHit(nsMsgKey key)
{
NS_ASSERTION(false, "shouldn't call this base class impl");
return NS_ERROR_FAILURE;
}
char *
-nsMsgSearchAdapter::GetImapCharsetParam(const PRUnichar *destCharset)
+nsMsgSearchAdapter::GetImapCharsetParam(const char16_t *destCharset)
{
char *result = nullptr;
// Specify a character set unless we happen to be US-ASCII.
if (NS_strcmp(destCharset, MOZ_UTF16("us-ascii")))
result = PR_smprintf("%s%s", nsMsgSearchAdapter::m_kImapCharset, NS_ConvertUTF16toUTF8(destCharset).get());
return result;
}
/*
09/21/2000 - taka@netscape.com
- This method is bogus. Escape must be done against char * not PRUnichar *
+ This method is bogus. Escape must be done against char * not char16_t *
should be rewritten later.
for now, just duplicate the string.
*/
-PRUnichar *nsMsgSearchAdapter::EscapeSearchUrl (const PRUnichar *nntpCommand)
+char16_t *nsMsgSearchAdapter::EscapeSearchUrl (const char16_t *nntpCommand)
{
return nntpCommand ? NS_strdup(nntpCommand) : nullptr;
}
/*
09/21/2000 - taka@netscape.com
- This method is bogus. Escape must be done against char * not PRUnichar *
+ This method is bogus. Escape must be done against char * not char16_t *
should be rewritten later.
for now, just duplicate the string.
*/
-PRUnichar *
-nsMsgSearchAdapter::EscapeImapSearchProtocol(const PRUnichar *imapCommand)
+char16_t *
+nsMsgSearchAdapter::EscapeImapSearchProtocol(const char16_t *imapCommand)
{
return imapCommand ? NS_strdup(imapCommand) : nullptr;
}
/*
09/21/2000 - taka@netscape.com
- This method is bogus. Escape must be done against char * not PRUnichar *
+ This method is bogus. Escape must be done against char * not char16_t *
should be rewritten later.
for now, just duplicate the string.
*/
-PRUnichar *
-nsMsgSearchAdapter::EscapeQuoteImapSearchProtocol(const PRUnichar *imapCommand)
+char16_t *
+nsMsgSearchAdapter::EscapeQuoteImapSearchProtocol(const char16_t *imapCommand)
{
return imapCommand ? NS_strdup(imapCommand) : nullptr;
}
char *nsMsgSearchAdapter::UnEscapeSearchUrl (const char *commandSpecificData)
{
char *result = (char*) PR_Malloc (strlen(commandSpecificData) + 1);
if (result)
@@ -286,17 +286,17 @@ nsMsgSearchAdapter::GetSearchCharsets(ns
// source text to US-ASCII. (Not for now.)
// if ((dst_csid == CS_LATIN1) || (dst_csid == CS_MAC_ROMAN))
dstCharset.AssignLiteral("us-ascii");
}
return NS_OK;
}
-nsresult nsMsgSearchAdapter::EncodeImapTerm (nsIMsgSearchTerm *term, bool reallyDredd, const PRUnichar *srcCharset, const PRUnichar *destCharset, char **ppOutTerm)
+nsresult nsMsgSearchAdapter::EncodeImapTerm (nsIMsgSearchTerm *term, bool reallyDredd, const char16_t *srcCharset, const char16_t *destCharset, char **ppOutTerm)
{
NS_ENSURE_ARG_POINTER(term);
NS_ENSURE_ARG_POINTER(ppOutTerm);
nsresult err = NS_OK;
bool useNot = false;
bool useQuotes = false;
bool ignoreValue = false;
@@ -519,34 +519,34 @@ nsresult nsMsgSearchAdapter::EncodeImapT
value = ToNewCString(searchTermValue);
valueWasAllocated = true;
}
else
if (IS_STRING_ATTRIBUTE(attrib))
{
- PRUnichar *convertedValue; // = reallyDredd ? MSG_EscapeSearchUrl (term->m_value.u.string) : msg_EscapeImapSearchProtocol(term->m_value.u.string);
+ char16_t *convertedValue; // = reallyDredd ? MSG_EscapeSearchUrl (term->m_value.u.string) : msg_EscapeImapSearchProtocol(term->m_value.u.string);
nsString searchTermValue;
searchValue->GetStr(searchTermValue);
// Ugly switch for Korean mail/news charsets.
// We want to do this here because here is where
// we know what charset we want to use.
#ifdef DOING_CHARSET
if (reallyDredd)
dest_csid = INTL_DefaultNewsCharSetID(dest_csid);
else
dest_csid = INTL_DefaultMailCharSetID(dest_csid);
#endif
// do all sorts of crazy escaping
convertedValue = reallyDredd ? EscapeSearchUrl (searchTermValue.get()) :
EscapeImapSearchProtocol(searchTermValue.get());
useQuotes = ((!reallyDredd ||
- (nsDependentString(convertedValue).FindChar(PRUnichar(' ')) != -1)) &&
+ (nsDependentString(convertedValue).FindChar(char16_t(' ')) != -1)) &&
(attrib != nsMsgSearchAttrib::Keywords));
// now convert to char* and escape quoted_specials
nsAutoCString valueStr;
nsresult rv = ConvertFromUnicode(NS_LossyConvertUTF16toASCII(destCharset).get(),
nsDependentString(convertedValue), valueStr);
if (NS_SUCCEEDED(rv))
{
const char *vptr = valueStr.get();
@@ -652,17 +652,17 @@ nsresult nsMsgSearchAdapter::EncodeImapV
PL_strcat (encoding, value);
if (useQuotes)
PL_strcat(encoding, "\"");
return NS_OK;
}
-nsresult nsMsgSearchAdapter::EncodeImap (char **ppOutEncoding, nsISupportsArray *searchTerms, const PRUnichar *srcCharset, const PRUnichar *destCharset, bool reallyDredd)
+nsresult nsMsgSearchAdapter::EncodeImap (char **ppOutEncoding, nsISupportsArray *searchTerms, const char16_t *srcCharset, const char16_t *destCharset, bool reallyDredd)
{
// i've left the old code (before using CBoolExpression for debugging purposes to make sure that
// the new code generates the same encoding string as the old code.....
nsresult err = NS_OK;
*ppOutEncoding = nullptr;
uint32_t termCount;
--- a/mailnews/base/search/src/nsMsgSearchImap.h
+++ b/mailnews/base/search/src/nsMsgSearchImap.h
@@ -19,17 +19,17 @@ public:
NS_IMETHOD ValidateTerms () MOZ_OVERRIDE;
NS_IMETHOD Search (bool *aDone) MOZ_OVERRIDE;
NS_IMETHOD GetEncoding (char **result) MOZ_OVERRIDE;
NS_IMETHOD AddResultElement (nsIMsgDBHdr *) MOZ_OVERRIDE;
static nsresult Encode (nsCString& ppEncoding,
nsISupportsArray *searchTerms,
- const PRUnichar *destCharset);
+ const char16_t *destCharset);
protected:
nsCString m_encoding;
};
--- a/mailnews/base/search/src/nsMsgSearchNews.cpp
+++ b/mailnews/base/search/src/nsMsgSearchNews.cpp
@@ -57,34 +57,34 @@ nsresult nsMsgSearchNews::ValidateTerms
nsresult nsMsgSearchNews::Search (bool *aDone)
{
// the state machine runs in the news: handler
nsresult err = NS_ERROR_NOT_IMPLEMENTED;
return err;
}
-PRUnichar *nsMsgSearchNews::EncodeToWildmat (const PRUnichar *value)
+char16_t *nsMsgSearchNews::EncodeToWildmat (const char16_t *value)
{
// Here we take advantage of XPAT's use of the wildmat format, which allows
// a case-insensitive match by specifying each case possibility for each character
// So, "FooBar" is encoded as "[Ff][Oo][Bb][Aa][Rr]"
- PRUnichar *caseInsensitiveValue = (PRUnichar*) nsMemory::Alloc(sizeof(PRUnichar) * ((4 * NS_strlen(value)) + 1));
+ char16_t *caseInsensitiveValue = (char16_t*) nsMemory::Alloc(sizeof(char16_t) * ((4 * NS_strlen(value)) + 1));
if (caseInsensitiveValue)
{
- PRUnichar *walkValue = caseInsensitiveValue;
+ char16_t *walkValue = caseInsensitiveValue;
while (*value)
{
if (isalpha(*value))
{
- *walkValue++ = (PRUnichar)'[';
- *walkValue++ = ToUpperCase((PRUnichar)*value);
- *walkValue++ = ToLowerCase((PRUnichar)*value);
- *walkValue++ = (PRUnichar)']';
+ *walkValue++ = (char16_t)'[';
+ *walkValue++ = ToUpperCase((char16_t)*value);
+ *walkValue++ = ToLowerCase((char16_t)*value);
+ *walkValue++ = (char16_t)']';
}
else
*walkValue++ = *value;
value++;
}
*walkValue = 0;
}
return caseInsensitiveValue;
@@ -165,35 +165,35 @@ char *nsMsgSearchNews::EncodeTerm (nsIMs
return nullptr;
nsString intlNonRFC1522Value;
rv = searchValue->GetStr(intlNonRFC1522Value);
if (NS_FAILED(rv) || intlNonRFC1522Value.IsEmpty())
return nullptr;
- PRUnichar *caseInsensitiveValue = EncodeToWildmat (intlNonRFC1522Value.get());
+ char16_t *caseInsensitiveValue = EncodeToWildmat (intlNonRFC1522Value.get());
if (!caseInsensitiveValue)
return nullptr;
// TO DO: Do INTL_FormatNNTPXPATInRFC1522Format trick for non-ASCII string
// Unfortunately, we currently do not handle xxx or xxx search in XPAT
// Need to add the INTL_FormatNNTPXPATInRFC1522Format call after we can do that
// so we should search a string in either RFC1522 format and non-RFC1522 format
- PRUnichar *escapedValue = EscapeSearchUrl (caseInsensitiveValue);
+ char16_t *escapedValue = EscapeSearchUrl (caseInsensitiveValue);
nsMemory::Free(caseInsensitiveValue);
if (!escapedValue)
return nullptr;
#if 0
// We also need to apply NET_Escape to it since we have to pass 8-bits data
// And sometimes % in the 7-bit doulbe byte JIS
//
- PRUnichar * urlEncoded = nsEscape(escapedValue, url_Path);
+ char16_t * urlEncoded = nsEscape(escapedValue, url_Path);
NS_Free(escapedValue);
if (! urlEncoded)
return nullptr;
char *pattern = new char [NS_strlen(urlEncoded) + overhead];
if (!pattern)
return nullptr;
--- a/mailnews/base/search/src/nsMsgSearchNews.h
+++ b/mailnews/base/search/src/nsMsgSearchNews.h
@@ -21,17 +21,17 @@ public:
NS_IMETHOD ValidateTerms () MOZ_OVERRIDE;
NS_IMETHOD Search (bool *aDone) MOZ_OVERRIDE;
NS_IMETHOD GetEncoding (char **result) MOZ_OVERRIDE;
NS_IMETHOD AddHit(nsMsgKey key) MOZ_OVERRIDE;
NS_IMETHOD CurrentUrlDone(nsresult exitCode) MOZ_OVERRIDE;
virtual nsresult Encode (nsCString *outEncoding);
virtual char *EncodeTerm (nsIMsgSearchTerm *);
- PRUnichar *EncodeToWildmat (const PRUnichar *);
+ char16_t *EncodeToWildmat (const char16_t *);
void ReportHits ();
void CollateHits ();
void ReportHit (nsIMsgDBHdr *pHeaders, nsIMsgFolder *folder);
protected:
nsCString m_encoding;
bool m_ORSearch; // set to true if any of the search terms contains an OR for a boolean operator.
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -322,17 +322,17 @@ nsMessenger::PromptIfFileExists(nsIFile
{
nsCOMPtr<nsIPrompt> dialog(do_GetInterface(mDocShell));
if (!dialog) return rv;
nsAutoString path;
bool dialogResult = false;
nsString errorMessage;
file->GetPath(path);
- const PRUnichar *pathFormatStrings[] = { path.get() };
+ const char16_t *pathFormatStrings[] = { path.get() };
if (!mStringBundle)
{
rv = InitStringBundle();
NS_ENSURE_SUCCESS(rv, rv);
}
rv = mStringBundle->FormatStringFromName(MOZ_UTF16("fileExists"),
pathFormatStrings, 1,
@@ -1260,17 +1260,17 @@ nsMessenger::GetSaveToDir(nsIFile **aSav
*aSaveDir = nullptr;
dir.swap(*aSaveDir);
return NS_OK;
}
NS_IMETHODIMP
nsMessenger::SaveMessages(uint32_t aCount,
- const PRUnichar **aFilenameArray,
+ const char16_t **aFilenameArray,
const char **aMessageUriArray)
{
NS_ENSURE_ARG_MIN(aCount, 1);
NS_ENSURE_ARG_POINTER(aFilenameArray);
NS_ENSURE_ARG_POINTER(aMessageUriArray);
nsresult rv;
@@ -2174,17 +2174,17 @@ NS_IMETHODIMP nsMessenger::OnItemIntProp
/* void OnItemBoolPropertyChanged (in nsIMsgFolder item, in nsIAtom property, in boolean oldValue, in boolean newValue); */
NS_IMETHODIMP nsMessenger::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void OnItemUnicharPropertyChanged (in nsIMsgFolder item, in nsIAtom property, in wstring oldValue, in wstring newValue); */
-NS_IMETHODIMP nsMessenger::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const PRUnichar *oldValue, const PRUnichar *newValue)
+NS_IMETHODIMP nsMessenger::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void OnItemPropertyFlagChanged (in nsIMsgDBHdr item, in nsIAtom property, in unsigned long oldFlag, in unsigned long newFlag); */
NS_IMETHODIMP nsMessenger::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
{
return NS_ERROR_NOT_IMPLEMENTED;
@@ -2954,23 +2954,23 @@ nsMessenger::PromptIfDeleteAttachments(b
// create the list of attachments we are removing
nsString displayString;
nsString attachmentList;
for (uint32_t u = 0; u < aCount; ++u)
{
ConvertAndSanitizeFileName(aDisplayNameArray[u], displayString);
attachmentList.Append(displayString);
- attachmentList.Append(PRUnichar('\n'));
+ attachmentList.Append(char16_t('\n'));
}
- const PRUnichar *formatStrings[] = { attachmentList.get() };
+ const char16_t *formatStrings[] = { attachmentList.get() };
// format the message and display
nsString promptMessage;
- const PRUnichar * propertyName = aSaveFirst ?
+ const char16_t * propertyName = aSaveFirst ?
MOZ_UTF16("detachAttachments") : MOZ_UTF16("deleteAttachments");
rv = mStringBundle->FormatStringFromName(propertyName, formatStrings, 1,getter_Copies(promptMessage));
NS_ENSURE_SUCCESS(rv, rv);
bool dialogResult = false;
rv = dialog->Confirm(nullptr, promptMessage.get(), &dialogResult);
NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/src/nsMessengerOS2Integration.cpp
+++ b/mailnews/base/src/nsMessengerOS2Integration.cpp
@@ -75,17 +75,17 @@ nsMessengerOS2Integration::Init()
NS_IMETHODIMP
nsMessengerOS2Integration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
{
return NS_OK;
}
NS_IMETHODIMP
-nsMessengerOS2Integration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const PRUnichar *, const PRUnichar *)
+nsMessengerOS2Integration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
{
return NS_OK;
}
NS_IMETHODIMP
nsMessengerOS2Integration::OnItemRemoved(nsIMsgFolder *, nsISupports *)
{
return NS_OK;
--- a/mailnews/base/src/nsMessengerOSXIntegration.h
+++ b/mailnews/base/src/nsMessengerOSXIntegration.h
@@ -38,17 +38,17 @@ public:
NS_DECL_NSIOBSERVER
NS_DECL_MOZINEWMAILLISTENER
private:
nsCOMPtr<nsIAtom> mBiffStateAtom;
nsCOMPtr<nsIAtom> mNewMailReceivedAtom;
nsresult ShowAlertMessage(const nsAString& aAlertTitle, const nsAString& aAlertText, const nsACString& aFolderURI);
nsresult OnAlertFinished();
- nsresult OnAlertClicked(const PRUnichar * aAlertCookie);
+ nsresult OnAlertClicked(const char16_t * aAlertCookie);
#ifdef MOZ_SUITE
nsresult OnAlertClickedSimple();
#endif
nsresult GetStringBundle(nsIStringBundle **aBundle);
void FillToolTipInfo(nsIMsgFolder *aFolder, int32_t aNewCount);
nsresult GetFirstFolderWithNewMail(nsIMsgFolder* aFolder, nsCString& aFolderURI);
nsresult BadgeDockIcon();
nsresult RestoreDockIcon();
--- a/mailnews/base/src/nsMessengerOSXIntegration.mm
+++ b/mailnews/base/src/nsMessengerOSXIntegration.mm
@@ -193,29 +193,29 @@ nsMessengerOSXIntegration::Init()
NS_IMETHODIMP
nsMessengerOSXIntegration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
{
return NS_OK;
}
NS_IMETHODIMP
-nsMessengerOSXIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const PRUnichar *, const PRUnichar *)
+nsMessengerOSXIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
{
return NS_OK;
}
NS_IMETHODIMP
nsMessengerOSXIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *)
{
return NS_OK;
}
NS_IMETHODIMP
-nsMessengerOSXIntegration::Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aData)
+nsMessengerOSXIntegration::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{
if (!strcmp(aTopic, "alertfinished"))
return OnAlertFinished();
if (!strcmp(aTopic, "alertclickcallback"))
return OnAlertClicked(aData);
#ifdef MOZ_SUITE
@@ -327,25 +327,25 @@ nsMessengerOSXIntegration::FillToolTipIn
nsString finalText;
nsCString uri;
aFolder->GetURI(uri);
if (numNotDisplayed > 0)
{
nsAutoString numNotDisplayedText;
numNotDisplayedText.AppendInt(numNotDisplayed);
- const PRUnichar *formatStrings[3] = { numNewMsgsText.get(), authors.get(), numNotDisplayedText.get() };
+ const char16_t *formatStrings[3] = { numNewMsgsText.get(), authors.get(), numNotDisplayedText.get() };
bundle->FormatStringFromName(MOZ_UTF16("macBiffNotification_messages_extra"),
formatStrings,
3,
getter_Copies(finalText));
}
else
{
- const PRUnichar *formatStrings[2] = { numNewMsgsText.get(), authors.get() };
+ const char16_t *formatStrings[2] = { numNewMsgsText.get(), authors.get() };
if (aNewCount == 1)
{
bundle->FormatStringFromName(MOZ_UTF16("macBiffNotification_message"),
formatStrings,
2,
getter_Copies(finalText));
// Since there is only 1 message, use the most recent mail's URI instead of the folder's
@@ -446,17 +446,17 @@ nsMessengerOSXIntegration::OnItemIntProp
else if (mNewMailReceivedAtom == aProperty)
{
FillToolTipInfo(aFolder, aNewValue);
}
return NS_OK;
}
nsresult
-nsMessengerOSXIntegration::OnAlertClicked(const PRUnichar* aAlertCookie)
+nsMessengerOSXIntegration::OnAlertClicked(const char16_t* aAlertCookie)
{
openMailWindow(NS_ConvertUTF16toUTF8(aAlertCookie));
return NS_OK;
}
#ifdef MOZ_SUITE
nsresult
nsMessengerOSXIntegration::OnAlertClickedSimple()
--- a/mailnews/base/src/nsMessengerUnixIntegration.cpp
+++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp
@@ -123,17 +123,17 @@ nsMessengerUnixIntegration::Init()
NS_IMETHODIMP
nsMessengerUnixIntegration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
{
return NS_OK;
}
NS_IMETHODIMP
-nsMessengerUnixIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const PRUnichar *, const PRUnichar *)
+nsMessengerUnixIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
{
return NS_OK;
}
NS_IMETHODIMP
nsMessengerUnixIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *)
{
return NS_OK;
@@ -162,17 +162,17 @@ nsMessengerUnixIntegration::BuildNotific
aFolder->GetNumNewMessages(true, &numNewMessages);
if (!numNewMessages)
return false;
nsAutoString numNewMsgsText;
numNewMsgsText.AppendInt(numNewMessages);
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
accountName.get(), numNewMsgsText.get()
};
aBundle->FormatStringFromName(numNewMessages == 1 ?
MOZ_UTF16("newMailNotification_message") :
MOZ_UTF16("newMailNotification_messages"),
formatStrings, 2, getter_Copies(aTitle));
@@ -283,17 +283,17 @@ nsMessengerUnixIntegration::BuildNotific
return false;
ExtractName(DecodedHeader(fullHeader), author);
}
if (showSubject && showSender)
{
nsString msgTitle;
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
subject.get(), author.get()
};
aBundle->FormatStringFromName(MOZ_UTF16("newMailNotification_messagetitle"),
formatStrings, 2, getter_Copies(msgTitle));
alertBody.Append(msgTitle);
}
else if (showSubject)
@@ -427,17 +427,17 @@ nsresult nsMessengerUnixIntegration::Ale
{
nsCString folderURI;
GetFirstFolderWithNewMail(folderURI);
openMailWindow(folderURI);
return NS_OK;
}
NS_IMETHODIMP
-nsMessengerUnixIntegration::Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aData)
+nsMessengerUnixIntegration::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{
if (strcmp(aTopic, "alertfinished") == 0)
return AlertFinished();
if (strcmp(aTopic, "alertclickcallback") == 0)
return AlertClicked();
return NS_OK;
}
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -369,32 +369,32 @@ nsMessengerWinIntegration::Init()
NS_ENSURE_SUCCESS(rv,rv);
rv = profilePath->GetPath(mProfilePath);
NS_ENSURE_SUCCESS(rv, rv);
// get application path
WCHAR appPath[_MAX_PATH] = {0};
::GetModuleFileNameW(nullptr, appPath, sizeof(appPath));
- mAppName.Assign((PRUnichar *)appPath);
+ mAppName.Assign((char16_t *)appPath);
rv = ResetCurrent();
NS_ENSURE_SUCCESS(rv,rv);
return NS_OK;
}
NS_IMETHODIMP
nsMessengerWinIntegration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
{
return NS_OK;
}
NS_IMETHODIMP
-nsMessengerWinIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const PRUnichar *, const PRUnichar *)
+nsMessengerWinIntegration::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
{
return NS_OK;
}
NS_IMETHODIMP
nsMessengerWinIntegration::OnItemRemoved(nsIMsgFolder *, nsISupports *)
{
return NS_OK;
@@ -641,17 +641,17 @@ nsresult nsMessengerWinIntegration::Aler
nsresult nsMessengerWinIntegration::AlertClickedSimple()
{
mSuppressBiffIcon = true;
return NS_OK;
}
#endif MOZ_SUITE
NS_IMETHODIMP
-nsMessengerWinIntegration::Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aData)
+nsMessengerWinIntegration::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{
if (strcmp(aTopic, "alertfinished") == 0)
return AlertFinished();
if (strcmp(aTopic, "alertclickcallback") == 0)
return AlertClicked();
#ifdef MOZ_SUITE
@@ -719,17 +719,17 @@ void nsMessengerWinIntegration::FillTool
folder->GetNumNewMessages(true, &numNewMessages);
nsCOMPtr<nsIStringBundle> bundle;
GetStringBundle(getter_AddRefs(bundle));
if (bundle)
{
nsAutoString numNewMsgsText;
numNewMsgsText.AppendInt(numNewMessages);
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
numNewMsgsText.get(),
};
nsString finalText;
if (numNewMessages == 1)
bundle->FormatStringFromName(MOZ_UTF16("biffNotification_message"), formatStrings, 1, getter_Copies(finalText));
else
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -232,17 +232,17 @@ nsMsgAccountManager::GetUserNeedsToAuthe
NS_IMETHODIMP
nsMsgAccountManager::SetUserNeedsToAuthenticate(bool aUserNeedsToAuthenticate)
{
m_userAuthenticated = !aUserNeedsToAuthenticate;
return NS_OK;
}
-NS_IMETHODIMP nsMsgAccountManager::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
+NS_IMETHODIMP nsMsgAccountManager::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData)
{
if(!strcmp(aTopic,NS_XPCOM_SHUTDOWN_OBSERVER_ID))
{
Shutdown();
return NS_OK;
}
if (!strcmp(aTopic, "quit-application-granted"))
{
@@ -3658,17 +3658,17 @@ nsMsgAccountManager::RemoveFolderFromSma
return NS_OK;
}
NS_IMETHODIMP nsMsgAccountManager::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
-NS_IMETHODIMP nsMsgAccountManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const PRUnichar *oldValue, const PRUnichar *newValue)
+NS_IMETHODIMP nsMsgAccountManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsMsgAccountManager::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
{
return NS_ERROR_NOT_IMPLEMENTED;
--- a/mailnews/base/src/nsMsgAccountManagerDS.cpp
+++ b/mailnews/base/src/nsMsgAccountManagerDS.cpp
@@ -1119,17 +1119,17 @@ nsMsgAccountManagerDataSource::OnServerC
nsresult
nsMsgAccountManagerDataSource::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
{
return NS_OK;
}
nsresult
-nsMsgAccountManagerDataSource::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const PRUnichar *, const PRUnichar *)
+nsMsgAccountManagerDataSource::OnItemUnicharPropertyChanged(nsIMsgFolder *, nsIAtom *, const char16_t *, const char16_t *)
{
return NS_OK;
}
nsresult
nsMsgAccountManagerDataSource::OnItemRemoved(nsIMsgFolder *, nsISupports *)
{
return NS_OK;
@@ -1169,14 +1169,14 @@ nsMsgAccountManagerDataSource::OnItemEve
nsresult
nsMsgAccountManagerDataSource::OnItemIntPropertyChanged(nsIMsgFolder *, nsIAtom *, int32_t, int32_t)
{
return NS_OK;
}
NS_IMETHODIMP
-nsMsgAccountManagerDataSource::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
+nsMsgAccountManagerDataSource::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
{
nsMsgRDFDataSource::Observe(aSubject, aTopic, aData);
return NS_OK;
}
--- a/mailnews/base/src/nsMsgBiffManager.cpp
+++ b/mailnews/base/src/nsMsgBiffManager.cpp
@@ -113,17 +113,17 @@ NS_IMETHODIMP nsMsgBiffManager::Shutdown
if (NS_SUCCEEDED(rv))
accountManager->RemoveIncomingServerListener(this);
mHaveShutdown = true;
mInited = false;
return NS_OK;
}
-NS_IMETHODIMP nsMsgBiffManager::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
+NS_IMETHODIMP nsMsgBiffManager::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData)
{
if (!strcmp(aTopic, "sleep_notification") && mBiffTimer)
{
mBiffTimer->Cancel();
mBiffTimer = nullptr;
}
else if (!strcmp(aTopic, "wake_notification"))
{
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -776,17 +776,17 @@ nsMsgContentPolicy::ShouldProcess(uint32
// think that ShouldLoad is going to catch all possible cases (i.e. that
// everything we use to make decisions is going to be available at
// ShouldLoad time, and not only become available in time for ShouldProcess).
// Do we think that's actually the case?
*aDecision = nsIContentPolicy::ACCEPT;
return NS_OK;
}
-NS_IMETHODIMP nsMsgContentPolicy::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
+NS_IMETHODIMP nsMsgContentPolicy::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
{
if (!strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic))
{
NS_LossyConvertUTF16toASCII pref(aData);
nsresult rv;
nsCOMPtr<nsIPrefBranch> prefBranchInt = do_QueryInterface(aSubject, &rv);
@@ -875,17 +875,17 @@ nsMsgContentPolicy::OnLocationChange(nsI
}
return NS_OK;
}
NS_IMETHODIMP
nsMsgContentPolicy::OnStatusChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsresult aStatus,
- const PRUnichar *aMessage)
+ const char16_t *aMessage)
{
return NS_OK;
}
NS_IMETHODIMP
nsMsgContentPolicy::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, uint32_t aState)
{
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -53,25 +53,25 @@
#include <algorithm>
using namespace mozilla::mailnews;
nsrefcnt nsMsgDBView::gInstanceCount = 0;
nsIAtom * nsMsgDBView::kJunkMsgAtom = nullptr;
nsIAtom * nsMsgDBView::kNotJunkMsgAtom = nullptr;
-PRUnichar * nsMsgDBView::kHighestPriorityString = nullptr;
-PRUnichar * nsMsgDBView::kHighPriorityString = nullptr;
-PRUnichar * nsMsgDBView::kLowestPriorityString = nullptr;
-PRUnichar * nsMsgDBView::kLowPriorityString = nullptr;
-PRUnichar * nsMsgDBView::kNormalPriorityString = nullptr;
-PRUnichar * nsMsgDBView::kReadString = nullptr;
-PRUnichar * nsMsgDBView::kRepliedString = nullptr;
-PRUnichar * nsMsgDBView::kForwardedString = nullptr;
-PRUnichar * nsMsgDBView::kNewString = nullptr;
+char16_t * nsMsgDBView::kHighestPriorityString = nullptr;
+char16_t * nsMsgDBView::kHighPriorityString = nullptr;
+char16_t * nsMsgDBView::kLowestPriorityString = nullptr;
+char16_t * nsMsgDBView::kLowPriorityString = nullptr;
+char16_t * nsMsgDBView::kNormalPriorityString = nullptr;
+char16_t * nsMsgDBView::kReadString = nullptr;
+char16_t * nsMsgDBView::kRepliedString = nullptr;
+char16_t * nsMsgDBView::kForwardedString = nullptr;
+char16_t * nsMsgDBView::kNewString = nullptr;
nsDateFormatSelector nsMsgDBView::m_dateFormatDefault = kDateFormatShort;
nsDateFormatSelector nsMsgDBView::m_dateFormatThisWeek = kDateFormatShort;
nsDateFormatSelector nsMsgDBView::m_dateFormatToday = kDateFormatNone;
static const uint32_t kMaxNumSortColumns = 2;
static void GetCachedName(const nsCString& unparsedString,
@@ -202,20 +202,20 @@ nsresult nsMsgDBView::InitLabelStrings()
prefString.Assign(PREF_LABELS_DESCRIPTION);
prefString.AppendInt(i + 1);
rv = GetPrefLocalizedString(prefString.get(), mLabelPrefDescriptions[i]);
}
return rv;
}
// helper function used to fetch strings from the messenger string bundle
-PRUnichar * nsMsgDBView::GetString(const PRUnichar *aStringName)
+char16_t * nsMsgDBView::GetString(const char16_t *aStringName)
{
nsresult res = NS_ERROR_UNEXPECTED;
- PRUnichar *ptrv = nullptr;
+ char16_t *ptrv = nullptr;
if (!mMessengerStringBundle)
{
static const char propertyURL[] = MESSENGER_STRING_URL;
nsCOMPtr<nsIStringBundleService> sBundleService =
mozilla::services::GetStringBundleService();
if (sBundleService)
res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mMessengerStringBundle));
@@ -788,17 +788,17 @@ nsresult nsMsgDBView::FetchTags(nsIMsgDB
nsAutoString tag;
for (uint32_t i = 0; i < keywordsArray.Length(); i++)
{
rv = mTagService->GetTagForKey(keywordsArray[i], tag);
if (NS_SUCCEEDED(rv) && !tag.IsEmpty())
{
if (!tags.IsEmpty())
- tags.Append((PRUnichar) ' ');
+ tags.Append((char16_t) ' ');
tags.Append(tag);
}
}
aTagString = tags;
return NS_OK;
}
@@ -951,17 +951,17 @@ nsresult nsMsgDBView::CycleThreadedColum
return NS_OK;
}
NS_IMETHODIMP nsMsgDBView::IsEditable(int32_t row, nsITreeColumn* col, bool* _retval)
{
NS_ENSURE_ARG_POINTER(col);
NS_ENSURE_ARG_POINTER(_retval);
//attempt to retreive a custom column handler. If it exists call it and return
- const PRUnichar* colID;
+ const char16_t* colID;
col->GetIdConst(&colID);
nsIMsgCustomColumnHandler* colHandler = GetColumnHandler(colID);
if (colHandler)
{
colHandler->IsEditable(row, col, _retval);
return NS_OK;
@@ -1315,17 +1315,17 @@ NS_IMETHODIMP nsMsgDBView::GetCellProper
rv = GetMsgHdrForViewIndex(aRow, getter_AddRefs(msgHdr));
if (NS_FAILED(rv) || !msgHdr)
{
ClearHdrCache();
return NS_MSG_INVALID_DBVIEW_INDEX;
}
- const PRUnichar* colID;
+ const char16_t* colID;
col->GetIdConst(&colID);
nsIMsgCustomColumnHandler* colHandler = GetColumnHandler(colID);
if (colHandler != nullptr)
colHandler->GetCellProperties(aRow, col, properties);
if (!properties.IsEmpty())
properties.Append(' ');
@@ -1641,17 +1641,17 @@ nsresult nsMsgDBView::GetDBForViewIndex(
NS_IF_ADDREF(*db = m_db);
return NS_OK;
}
NS_IMETHODIMP nsMsgDBView::GetImageSrc(int32_t aRow, nsITreeColumn* aCol, nsAString& aValue)
{
NS_ENSURE_ARG_POINTER(aCol);
//attempt to retreive a custom column handler. If it exists call it and return
- const PRUnichar* colID;
+ const char16_t* colID;
aCol->GetIdConst(&colID);
nsIMsgCustomColumnHandler* colHandler = GetColumnHandler(colID);
if (colHandler)
{
colHandler->GetImageSrc(aRow, aCol, aValue);
return NS_OK;
@@ -1675,17 +1675,17 @@ NS_IMETHODIMP nsMsgDBView::GetCellValue(
nsresult rv = GetMsgHdrForViewIndex(aRow, getter_AddRefs(msgHdr));
if (NS_FAILED(rv) || !msgHdr)
{
ClearHdrCache();
return NS_MSG_INVALID_DBVIEW_INDEX;
}
- const PRUnichar* colID;
+ const char16_t* colID;
aCol->GetIdConst(&colID);
uint32_t flags;
msgHdr->GetFlags(&flags);
aValue.Truncate();
// provide a string "value" for cells that do not normally have text.
// use empty string for the normal states "Read", "Not Starred", "No Attachment" and "Not Junk"
@@ -1866,33 +1866,33 @@ NS_IMETHODIMP nsMsgDBView::GetCurCustomC
m_db->GetDBFolderInfo(getter_AddRefs(dbInfo));
if (!dbInfo)
return NS_ERROR_FAILURE;
return dbInfo->GetProperty("customSortCol", result);
}
-nsIMsgCustomColumnHandler* nsMsgDBView::GetColumnHandler(const PRUnichar *colID)
+nsIMsgCustomColumnHandler* nsMsgDBView::GetColumnHandler(const char16_t *colID)
{
int32_t index = m_customColumnHandlerIDs.IndexOf(nsDependentString(colID));
return (index > -1) ? m_customColumnHandlers[index] : nullptr;
}
NS_IMETHODIMP nsMsgDBView::GetColumnHandler(const nsAString& aColID, nsIMsgCustomColumnHandler** aHandler)
{
NS_ENSURE_ARG_POINTER(aHandler);
nsAutoString column(aColID);
NS_IF_ADDREF(*aHandler = GetColumnHandler(column.get()));
return (*aHandler) ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsMsgDBView::GetCellText(int32_t aRow, nsITreeColumn* aCol, nsAString& aValue)
{
- const PRUnichar* colID;
+ const char16_t* colID;
aCol->GetIdConst(&colID);
if (!IsValidIndex(aRow))
return NS_MSG_INVALID_DBVIEW_INDEX;
aValue.Truncate();
//attempt to retreive a custom column handler. If it exists call it and return
@@ -1903,17 +1903,17 @@ NS_IMETHODIMP nsMsgDBView::GetCellText(i
colHandler->GetCellText(aRow, aCol, aValue);
return NS_OK;
}
return CellTextForColumn(aRow, colID, aValue);
}
NS_IMETHODIMP nsMsgDBView::CellTextForColumn(int32_t aRow,
- const PRUnichar *aColumnName,
+ const char16_t *aColumnName,
nsAString &aValue)
{
nsCOMPtr<nsIMsgDBHdr> msgHdr;
nsresult rv = GetMsgHdrForViewIndex(aRow, getter_AddRefs(msgHdr));
if (NS_FAILED(rv) || !msgHdr)
{
ClearHdrCache();
@@ -2040,17 +2040,17 @@ NS_IMETHODIMP nsMsgDBView::CycleHeader(n
return NS_OK;
}
NS_IMETHODIMP nsMsgDBView::CycleCell(int32_t row, nsITreeColumn* col)
{
if (!IsValidIndex(row))
return NS_MSG_INVALID_DBVIEW_INDEX;
- const PRUnichar* colID;
+ const char16_t* colID;
col->GetIdConst(&colID);
//attempt to retreive a custom column handler. If it exists call it and return
nsIMsgCustomColumnHandler* colHandler = GetColumnHandler(colID);
if (colHandler)
{
colHandler->CycleCell(row, col);
@@ -2106,27 +2106,27 @@ NS_IMETHODIMP nsMsgDBView::CycleCell(int
break;
default:
break;
}
return NS_OK;
}
-NS_IMETHODIMP nsMsgDBView::PerformAction(const PRUnichar *action)
+NS_IMETHODIMP nsMsgDBView::PerformAction(const char16_t *action)
{
return NS_OK;
}
-NS_IMETHODIMP nsMsgDBView::PerformActionOnRow(const PRUnichar *action, int32_t row)
+NS_IMETHODIMP nsMsgDBView::PerformActionOnRow(const char16_t *action, int32_t row)
{
return NS_OK;
}
-NS_IMETHODIMP nsMsgDBView::PerformActionOnCell(const PRUnichar *action, int32_t row, nsITreeColumn* col)
+NS_IMETHODIMP nsMsgDBView::PerformActionOnCell(const char16_t *action, int32_t row, nsITreeColumn* col)
{
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////
// end nsITreeView Implementation Methods
///////////////////////////////////////////////////////////////////////////
@@ -3995,25 +3995,25 @@ nsresult nsMsgDBView::EncodeColumnSort(n
for (uint32_t i = 0; i < m_sortColumns.Length(); i++)
{
MsgViewSortColumnInfo &sortInfo = m_sortColumns[i];
columnSortString.Append((char) sortInfo.mSortType);
columnSortString.Append((char) sortInfo.mSortOrder + '0');
if (sortInfo.mSortType == nsMsgViewSortType::byCustom)
{
columnSortString.Append(sortInfo.mCustomColumnName);
- columnSortString.Append((PRUnichar) '\r');
+ columnSortString.Append((char16_t) '\r');
}
}
return NS_OK;
}
nsresult nsMsgDBView::DecodeColumnSort(nsString &columnSortString)
{
- const PRUnichar *stringPtr = columnSortString.BeginReading();
+ const char16_t *stringPtr = columnSortString.BeginReading();
while (*stringPtr)
{
MsgViewSortColumnInfo sortColumnInfo;
sortColumnInfo.mSortType = (nsMsgViewSortTypeValue) *stringPtr++;
sortColumnInfo.mSortOrder = (nsMsgViewSortOrderValue) (*stringPtr++) - '0';
if (sortColumnInfo.mSortType == nsMsgViewSortType::byCustom)
{
while (*stringPtr && *stringPtr != '\r')
--- a/mailnews/base/src/nsMsgDBView.h
+++ b/mailnews/base/src/nsMsgDBView.h
@@ -111,29 +111,29 @@ public:
nsMsgViewSortOrderValue sortOrder,
nsMsgViewSortTypeValue sortType);
int32_t SecondarySort(nsMsgKey key1, nsISupports *folder1, nsMsgKey key2, nsISupports *folder2,
class viewSortInfo *comparisonContext);
protected:
static nsrefcnt gInstanceCount;
- static PRUnichar* kHighestPriorityString;
- static PRUnichar* kHighPriorityString;
- static PRUnichar* kLowestPriorityString;
- static PRUnichar* kLowPriorityString;
- static PRUnichar* kNormalPriorityString;
+ static char16_t* kHighestPriorityString;
+ static char16_t* kHighPriorityString;
+ static char16_t* kLowestPriorityString;
+ static char16_t* kLowPriorityString;
+ static char16_t* kNormalPriorityString;
static nsIAtom* kJunkMsgAtom;
static nsIAtom* kNotJunkMsgAtom;
- static PRUnichar* kReadString;
- static PRUnichar* kRepliedString;
- static PRUnichar* kForwardedString;
- static PRUnichar* kNewString;
+ static char16_t* kReadString;
+ static char16_t* kRepliedString;
+ static char16_t* kForwardedString;
+ static char16_t* kNewString;
nsCOMPtr<nsITreeBoxObject> mTree;
nsCOMPtr<nsITreeSelection> mTreeSelection;
uint32_t mNumSelectedRows; // we cache this to determine when to push command status notifications.
bool mSuppressMsgDisplay; // set when the message pane is collapsed
bool mSuppressCommandUpdating;
bool mRemovingRow; // set when we're telling the outline a row is being removed. used to suppress msg loading.
// during delete/move operations.
@@ -339,17 +339,17 @@ protected:
nsresult FindPrevFlagged(nsMsgViewIndex startIndex, nsMsgViewIndex *pResultIndex);
nsresult MarkThreadOfMsgRead(nsMsgKey msgId, nsMsgViewIndex msgIndex, nsTArray<nsMsgKey> &idsMarkedRead, bool bRead);
nsresult MarkThreadRead(nsIMsgThread *threadHdr, nsMsgViewIndex threadIndex, nsTArray<nsMsgKey> &idsMarkedRead, bool bRead);
bool IsValidIndex(nsMsgViewIndex index);
nsresult ToggleIgnored(nsMsgViewIndex * indices, int32_t numIndices, nsMsgViewIndex *resultIndex, bool *resultToggleState);
nsresult ToggleMessageKilled(nsMsgViewIndex * indices, int32_t numIndices, nsMsgViewIndex *resultIndex, bool *resultToggleState);
bool OfflineMsgSelected(nsMsgViewIndex * indices, int32_t numIndices);
bool NonDummyMsgSelected(nsMsgViewIndex * indices, int32_t numIndices);
- PRUnichar * GetString(const PRUnichar *aStringName);
+ char16_t * GetString(const char16_t *aStringName);
nsresult GetPrefLocalizedString(const char *aPrefName, nsString& aResult);
nsresult GetLabelPrefStringAndAtom(const char *aPrefName, nsString& aColor, nsIAtom** aColorAtom);
nsresult AppendKeywordProperties(const nsACString& keywords, nsAString& properties, bool addSelectedTextProperty);
nsresult InitLabelStrings(void);
nsresult CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater);
void InitializeAtomsAndLiterals();
virtual int32_t FindLevelInThread(nsIMsgDBHdr *msgHdr, nsMsgViewIndex startOfThread, nsMsgViewIndex viewIndex);
nsresult GetImapDeleteModel(nsIMsgFolder *folder);
@@ -439,17 +439,17 @@ protected:
uint32_t mRecentlyDeletedArrayIndex;
void RememberDeletedMsgHdr(nsIMsgDBHdr *msgHdr);
bool WasHdrRecentlyDeleted(nsIMsgDBHdr *msgHdr);
//these hold pointers (and IDs) for the nsIMsgCustomColumnHandler object that constitutes the custom column handler
nsCOMArray <nsIMsgCustomColumnHandler> m_customColumnHandlers;
nsTArray<nsString> m_customColumnHandlerIDs;
- nsIMsgCustomColumnHandler* GetColumnHandler(const PRUnichar*);
+ nsIMsgCustomColumnHandler* GetColumnHandler(const char16_t*);
nsIMsgCustomColumnHandler* GetCurColumnHandlerFromDBInfo();
#ifdef DEBUG_David_Bienvenu
void InitEntryInfoForIndex(nsMsgViewIndex i, IdKeyPtr &EntryInfo);
void ValidateSort();
#endif
protected:
--- a/mailnews/base/src/nsMsgFolderDataSource.cpp
+++ b/mailnews/base/src/nsMsgFolderDataSource.cpp
@@ -829,18 +829,18 @@ nsMsgFolderDataSource::OnItemIntProperty
NotifyPropertyChanged(resource, kNC_BiffState, biffNode);
}
return NS_OK;
}
NS_IMETHODIMP
nsMsgFolderDataSource::OnItemUnicharPropertyChanged(nsIMsgFolder *folder,
nsIAtom *property,
- const PRUnichar *oldValue,
- const PRUnichar *newValue)
+ const char16_t *oldValue,
+ const char16_t *newValue)
{
nsCOMPtr<nsIRDFResource> resource(do_QueryInterface(folder));
if (kNameAtom == property)
{
int32_t numUnread;
folder->GetNumUnread(false, &numUnread);
NotifyFolderTreeNameChanged(folder, resource, numUnread);
NotifyFolderTreeSimpleNameChanged(folder, resource);
@@ -1492,17 +1492,17 @@ nsMsgFolderDataSource::createBiffStateNo
NS_ENSURE_SUCCESS(rv,rv);
return NS_OK;
}
nsresult
nsMsgFolderDataSource::createBiffStateNodeFromFlag(uint32_t flag, nsIRDFNode **target)
{
- const PRUnichar *biffStateStr;
+ const char16_t *biffStateStr;
switch (flag) {
case nsIMsgFolder::nsMsgBiffState_NewMail:
biffStateStr = MOZ_UTF16("NewMail");
break;
case nsIMsgFolder::nsMsgBiffState_NoMail:
biffStateStr = MOZ_UTF16("NoMail");
break;
@@ -2006,17 +2006,17 @@ nsresult nsMsgFolderDataSource::DoFolder
{
nsresult rv = NS_ERROR_FAILURE;
if (kNC_Charset == property)
{
nsCOMPtr<nsIRDFLiteral> literal(do_QueryInterface(target));
if(literal)
{
- const PRUnichar* value;
+ const char16_t* value;
rv = literal->GetValueConst(&value);
if(NS_SUCCEEDED(rv))
rv = folder->SetCharset(NS_LossyConvertUTF16toASCII(value));
}
else
rv = NS_ERROR_FAILURE;
}
else if (kNC_Open == property && target == kTrueLiteral)
--- a/mailnews/base/src/nsMsgGroupView.cpp
+++ b/mailnews/base/src/nsMsgGroupView.cpp
@@ -713,17 +713,17 @@ NS_IMETHODIMP nsMsgGroupView::GetCellPro
aProperties.AssignLiteral("dummy");
return NS_OK;
}
return nsMsgDBView::GetCellProperties(aRow, aCol, aProperties);
}
NS_IMETHODIMP nsMsgGroupView::CellTextForColumn(int32_t aRow,
- const PRUnichar *aColumnName,
+ const char16_t *aColumnName,
nsAString &aValue) {
if (!IsValidIndex(aRow))
return NS_MSG_INVALID_DBVIEW_INDEX;
if (m_flags[aRow] & MSG_VIEW_FLAG_DUMMY && aColumnName[0] != 'u')
{
nsCOMPtr <nsIMsgDBHdr> msgHdr;
nsresult rv = GetMsgHdrForViewIndex(aRow, getter_AddRefs(msgHdr));
--- a/mailnews/base/src/nsMsgGroupView.h
+++ b/mailnews/base/src/nsMsgGroupView.h
@@ -33,17 +33,17 @@ public:
NS_IMETHOD OnHdrDeleted(nsIMsgDBHdr *aHdrDeleted, nsMsgKey aParentKey, int32_t aFlags,
nsIDBChangeListener *aInstigator) MOZ_OVERRIDE;
NS_IMETHOD OnHdrFlagsChanged(nsIMsgDBHdr *aHdrChanged, uint32_t aOldFlags,
uint32_t aNewFlags, nsIDBChangeListener *aInstigator) MOZ_OVERRIDE;
NS_IMETHOD LoadMessageByViewIndex(nsMsgViewIndex aViewIndex);
NS_IMETHOD GetCellProperties(int32_t aRow, nsITreeColumn *aCol, nsAString& aProperties) MOZ_OVERRIDE;
NS_IMETHOD GetRowProperties(int32_t aRow, nsAString& aProperties) MOZ_OVERRIDE;
- NS_IMETHOD CellTextForColumn(int32_t aRow, const PRUnichar *aColumnName,
+ NS_IMETHOD CellTextForColumn(int32_t aRow, const char16_t *aColumnName,
nsAString &aValue);
NS_IMETHOD GetThreadContainingMsgHdr(nsIMsgDBHdr *msgHdr, nsIMsgThread **pThread);
protected:
virtual void InternalClose();
nsMsgGroupThread *AddHdrToThread(nsIMsgDBHdr *msgHdr, bool *pNewThread);
virtual nsresult HashHdr(nsIMsgDBHdr *msgHdr, nsString& aHashKey);
nsresult GetAgeBucketValue(nsIMsgDBHdr *aMsgHdr, uint32_t * aAgeBucket, bool rcvDate = false); // helper function to get the age bucket for a hdr, useful when grouped by date
--- a/mailnews/base/src/nsMsgMailSession.cpp
+++ b/mailnews/base/src/nsMsgMailSession.cpp
@@ -106,18 +106,18 @@ nsMsgMailSession::OnItemPropertyChanged(
NOTIFY_FOLDER_LISTENERS(propertyChanged, OnItemPropertyChanged,
(aItem, aProperty, aOldValue, aNewValue));
return NS_OK;
}
NS_IMETHODIMP
nsMsgMailSession::OnItemUnicharPropertyChanged(nsIMsgFolder *aItem,
nsIAtom *aProperty,
- const PRUnichar* aOldValue,
- const PRUnichar* aNewValue)
+ const char16_t* aOldValue,
+ const char16_t* aNewValue)
{
NOTIFY_FOLDER_LISTENERS(unicharPropertyChanged, OnItemUnicharPropertyChanged,
(aItem, aProperty, aOldValue, aNewValue));
return NS_OK;
}
NS_IMETHODIMP
nsMsgMailSession::OnItemIntPropertyChanged(nsIMsgFolder *aItem,
@@ -595,17 +595,17 @@ NS_IMETHODIMP nsMsgShutdownService::SetS
{
NS_ENSURE_TRUE(mMsgProgress, NS_ERROR_FAILURE);
mMsgProgress->RegisterListener(inListener);
return NS_OK;
}
NS_IMETHODIMP nsMsgShutdownService::Observe(nsISupports *aSubject,
const char *aTopic,
- const PRUnichar *aData)
+ const char16_t *aData)
{
// Due to bug 459376 we don't always get quit-application-requested and
// quit-application-granted. quit-application-requested is preferred, but if
// we don't then we have to hook onto quit-application, but we don't want
// to do the checking twice so we set some flags to prevent that.
if (!strcmp(aTopic, "quit-application-granted"))
{
// Quit application has been requested and granted, therefore we will shut
--- a/mailnews/base/src/nsMsgOfflineManager.cpp
+++ b/mailnews/base/src/nsMsgOfflineManager.cpp
@@ -337,17 +337,17 @@ NS_IMETHODIMP
nsMsgOfflineManager::OnStopRunningUrl(nsIURI * aUrl, nsresult aExitCode)
{
mOfflineImapSync = nullptr;
AdvanceToNextState(aExitCode);
return NS_OK;
}
-NS_IMETHODIMP nsMsgOfflineManager::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
+NS_IMETHODIMP nsMsgOfflineManager::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData)
{
return NS_OK;
}
// nsIMsgSendLaterListener implementation
NS_IMETHODIMP
nsMsgOfflineManager::OnStartSending(uint32_t aTotalMessageCount)
{
@@ -375,24 +375,24 @@ nsMsgOfflineManager::OnMessageSendProgre
return NS_OK;
}
NS_IMETHODIMP
nsMsgOfflineManager::OnMessageSendError(uint32_t aCurrentMessage,
nsIMsgDBHdr *aMessageHeader,
nsresult aStatus,
- const PRUnichar *aMsg)
+ const char16_t *aMsg)
{
return NS_OK;
}
NS_IMETHODIMP
nsMsgOfflineManager::OnStopSending(nsresult aStatus,
- const PRUnichar *aMsg, uint32_t aTotalTried,
+ const char16_t *aMsg, uint32_t aTotalTried,
uint32_t aSuccessful)
{
#ifdef NS_DEBUG
if (NS_SUCCEEDED(aStatus))
printf("SendLaterListener::OnStopSending: Tried to send %d messages. %d successful.\n",
aTotalTried, aSuccessful);
#endif
return AdvanceToNextState(aStatus);
--- a/mailnews/base/src/nsMsgPrintEngine.cpp
+++ b/mailnews/base/src/nsMsgPrintEngine.cpp
@@ -191,17 +191,17 @@ nsMsgPrintEngine::OnLocationChange(nsIWe
return NS_OK;
}
NS_IMETHODIMP
nsMsgPrintEngine::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
- const PRUnichar* aMessage)
+ const char16_t* aMessage)
{
return NS_OK;
}
NS_IMETHODIMP
nsMsgPrintEngine::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
@@ -289,17 +289,17 @@ nsMsgPrintEngine::ShowWindow(bool aShow)
// hide or show the window
baseWindow->SetVisibility(aShow);
}
return rv;
}
NS_IMETHODIMP
-nsMsgPrintEngine::AddPrintURI(const PRUnichar *aMsgURI)
+nsMsgPrintEngine::AddPrintURI(const char16_t *aMsgURI)
{
NS_ENSURE_ARG_POINTER(aMsgURI);
mURIArray.AppendElement(nsDependentString(aMsgURI));
return NS_OK;
}
NS_IMETHODIMP
@@ -556,17 +556,17 @@ nsMsgPrintEngine::SetStatusMessage(const
mFeedback->ShowStatusString(aMsgString);
return NS_OK;
}
#define MESSENGER_STRING_URL "chrome://messenger/locale/messenger.properties"
void
-nsMsgPrintEngine::GetString(const PRUnichar *aStringName, nsString& outStr)
+nsMsgPrintEngine::GetString(const char16_t *aStringName, nsString& outStr)
{
outStr.Truncate();
if (!mStringBundle)
{
static const char propertyURL[] = MESSENGER_STRING_URL;
nsCOMPtr<nsIStringBundleService> sBundleService =
@@ -733,12 +733,12 @@ NS_IMETHODIMP nsMsgPrintEngine::SetMsgTy
{
mMsgInx = aMsgType;
return NS_OK;
}
return NS_ERROR_FAILURE;
}
/*=============== nsIObserver Interface ======================*/
-NS_IMETHODIMP nsMsgPrintEngine::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
+NS_IMETHODIMP nsMsgPrintEngine::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
{
return FireThatLoadOperation(mLoadURI);
}
--- a/mailnews/base/src/nsMsgPrintEngine.h
+++ b/mailnews/base/src/nsMsgPrintEngine.h
@@ -56,17 +56,17 @@ protected:
bool FirePrintEvent();
nsresult FireStartNextEvent();
nsresult FireThatLoadOperationStartup(const nsString& uri);
nsresult FireThatLoadOperation(const nsString& uri);
void InitializeDisplayCharset();
void SetupObserver();
nsresult SetStatusMessage(const nsString& aMsgString);
- void GetString(const PRUnichar *aStringName, nsString& aOutString);
+ void GetString(const char16_t *aStringName, nsString& aOutString);
nsresult ShowProgressDialog(bool aIsForPrinting, bool& aDoNotify);
nsCOMPtr<nsIDocShell> mDocShell;
nsCOMPtr<nsIDOMWindow> mWindow;
nsCOMPtr<nsIDOMWindow> mParentWindow;
int32_t mURICount;
nsTArray<nsString> mURIArray;
int32_t mCurrentlyPrintingURI;
--- a/mailnews/base/src/nsMsgProgress.cpp
+++ b/mailnews/base/src/nsMsgProgress.cpp
@@ -157,17 +157,17 @@ NS_IMETHODIMP nsMsgProgress::OnProgressC
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location, in unsigned long aFlags); */
NS_IMETHODIMP nsMsgProgress::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location, uint32_t aFlags)
{
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
-NS_IMETHODIMP nsMsgProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
+NS_IMETHODIMP nsMsgProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const char16_t *aMessage)
{
if (aMessage && *aMessage)
m_pendingStatus = aMessage;
for (int32_t i = m_listenerList.Count() - 1; i >= 0; i --)
m_listenerList[i]->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
return NS_OK;
}
@@ -239,17 +239,17 @@ NS_IMETHODIMP nsMsgProgress::OnProgress(
{
// XXX: What should the nsIWebProgress be?
// XXX: This truncates 64-bit to 32-bit
return OnProgressChange(nullptr, request, int32_t(aProgress), int32_t(aProgressMax),
int32_t(aProgress) /* current total progress */, int32_t(aProgressMax) /* max total progress */);
}
NS_IMETHODIMP nsMsgProgress::OnStatus(nsIRequest *request, nsISupports* ctxt,
- nsresult aStatus, const PRUnichar* aStatusArg)
+ nsresult aStatus, const char16_t* aStatusArg)
{
nsresult rv;
nsCOMPtr<nsIStringBundleService> sbs =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(sbs, NS_ERROR_UNEXPECTED);
nsString str;
rv = sbs->FormatStatusMessage(aStatus, aStatusArg, getter_Copies(str));
NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/src/nsMsgRDFDataSource.cpp
+++ b/mailnews/base/src/nsMsgRDFDataSource.cpp
@@ -264,17 +264,17 @@ NS_IMETHODIMP
nsMsgRDFDataSource::EndUpdateBatch()
{
return NS_OK;
}
/* XPCOM Shutdown observer */
NS_IMETHODIMP
-nsMsgRDFDataSource::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData )
+nsMsgRDFDataSource::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData )
{
if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
m_shuttingDown = true;
Cleanup();
}
return NS_OK;
}
--- a/mailnews/base/src/nsMsgRDFUtils.cpp
+++ b/mailnews/base/src/nsMsgRDFUtils.cpp
@@ -3,17 +3,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsMsgRDFUtils.h"
#include "nsIServiceManager.h"
#include "prprf.h"
#include "nsCOMPtr.h"
#include "nsMemory.h"
-nsresult createNode(const PRUnichar *str, nsIRDFNode **node, nsIRDFService *rdfService)
+nsresult createNode(const char16_t *str, nsIRDFNode **node, nsIRDFService *rdfService)
{
nsresult rv;
nsCOMPtr<nsIRDFLiteral> value;
NS_ASSERTION(rdfService, "rdfService is null");
if (!rdfService) return NS_OK;
if (str) {
--- a/mailnews/base/src/nsMsgRDFUtils.h
+++ b/mailnews/base/src/nsMsgRDFUtils.h
@@ -84,17 +84,17 @@ typedef struct _nsMsgRDFNotification {
#define NC_RDF_MOVEFOLDER NC_NAMESPACE_URI "MoveFolder"
#define NC_RDF_MARKALLMESSAGESREAD NC_NAMESPACE_URI "MarkAllMessagesRead"
#define NC_RDF_COMPACT NC_NAMESPACE_URI "Compact"
#define NC_RDF_COMPACTALL NC_NAMESPACE_URI "CompactAll"
#define NC_RDF_RENAME NC_NAMESPACE_URI "Rename"
#define NC_RDF_EMPTYTRASH NC_NAMESPACE_URI "EmptyTrash"
-nsresult createNode(const PRUnichar *str, nsIRDFNode **, nsIRDFService *rdfService);
+nsresult createNode(const char16_t *str, nsIRDFNode **, nsIRDFService *rdfService);
//Given an int32_t creates an nsIRDFNode that is really an int literal.
nsresult createIntNode(int32_t value, nsIRDFNode **node, nsIRDFService *rdfService);
//Given an nsIRDFBlob creates an nsIRDFNode that is really an blob literal.
nsresult createBlobNode(uint8_t *value, uint32_t &length, nsIRDFNode **node, nsIRDFService *rdfService);
//s Assertion for a datasource that will just call GetTarget on property. When all of our
--- a/mailnews/base/src/nsMsgSearchDBView.cpp
+++ b/mailnews/base/src/nsMsgSearchDBView.cpp
@@ -160,17 +160,17 @@ void nsMsgSearchDBView::InternalClose()
m_folders.Clear();
}
NS_IMETHODIMP nsMsgSearchDBView::GetCellText(int32_t aRow, nsITreeColumn* aCol, nsAString& aValue)
{
NS_ENSURE_TRUE(IsValidIndex(aRow), NS_MSG_INVALID_DBVIEW_INDEX);
NS_ENSURE_ARG_POINTER(aCol);
- const PRUnichar* colID;
+ const char16_t* colID;
aCol->GetIdConst(&colID);
// the only thing we contribute is location; dummy rows have no location, so
// bail in that case. otherwise, check if we are dealing with 'location'.
// location, need to check for "lo" not just "l" to avoid "label" column
if (!(m_flags[aRow] & MSG_VIEW_FLAG_DUMMY) &&
colID[0] == 'l' && colID[1] == 'o')
return FetchLocation(aRow, aValue);
else
--- a/mailnews/base/src/nsMsgStatusFeedback.cpp
+++ b/mailnews/base/src/nsMsgStatusFeedback.cpp
@@ -157,17 +157,17 @@ NS_IMETHODIMP nsMsgStatusFeedback::OnLoc
{
return NS_OK;
}
NS_IMETHODIMP
nsMsgStatusFeedback::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
- const PRUnichar* aMessage)
+ const char16_t* aMessage)
{
return NS_OK;
}
NS_IMETHODIMP
nsMsgStatusFeedback::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
@@ -250,17 +250,17 @@ NS_IMETHODIMP nsMsgStatusFeedback::OnPro
{
// XXX: What should the nsIWebProgress be?
// XXX: this truncates 64-bit to 32-bit
return OnProgressChange(nullptr, request, int32_t(aProgress), int32_t(aProgressMax),
int32_t(aProgress) /* current total progress */, int32_t(aProgressMax) /* max total progress */);
}
NS_IMETHODIMP nsMsgStatusFeedback::OnStatus(nsIRequest *request, nsISupports* ctxt,
- nsresult aStatus, const PRUnichar* aStatusArg)
+ nsresult aStatus, const char16_t* aStatusArg)
{
nsresult rv;
nsCOMPtr<nsIURI> uri;
nsString accountName;
// fetching account name from nsIRequest
nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
rv = aChannel->GetURI(getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv);
@@ -283,17 +283,17 @@ NS_IMETHODIMP nsMsgStatusFeedback::OnSta
// prefixing the account name to the status message if status message isn't blank
// and doesn't already contain the account name.
nsString statusMessage;
if (!str.IsEmpty() && str.Find(accountName) == kNotFound)
{
nsCOMPtr<nsIStringBundle> bundle;
rv = sbs->CreateBundle(MSGS_URL, getter_AddRefs(bundle));
- const PRUnichar *params[] = { accountName.get(),
+ const char16_t *params[] = { accountName.get(),
str.get() };
rv = bundle->FormatStringFromName(
MOZ_UTF16("statusMessage"),
params, 2, getter_Copies(statusMessage));
NS_ENSURE_SUCCESS(rv, rv);
}
else
{
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -676,17 +676,17 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
- const PRUnichar *junkLogDetectFormatStrings[3] = { authorValue.get(), subjectValue.get(), dateValue.get() };
+ const char16_t *junkLogDetectFormatStrings[3] = { authorValue.get(), subjectValue.get(), dateValue.get() };
nsString junkLogDetectStr;
rv = bundle->FormatStringFromName(
MOZ_UTF16("junkLogDetectStr"),
junkLogDetectFormatStrings, 3,
getter_Copies(junkLogDetectStr));
NS_ENSURE_SUCCESS(rv, rv);
buffer += NS_ConvertUTF16toUTF8(junkLogDetectStr);
@@ -698,17 +698,17 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit
nsCString junkFolderURI;
rv = GetSpamFolderURI(getter_Copies(junkFolderURI));
NS_ENSURE_SUCCESS(rv, rv);
NS_ConvertASCIItoUTF16 msgIdValue(msgId);
NS_ConvertASCIItoUTF16 junkFolderURIValue(junkFolderURI);
- const PRUnichar *logMoveFormatStrings[2] = { msgIdValue.get(), junkFolderURIValue.get() };
+ const char16_t *logMoveFormatStrings[2] = { msgIdValue.get(), junkFolderURIValue.get() };
nsString logMoveStr;
rv = bundle->FormatStringFromName(
MOZ_UTF16("logMoveStr"),
logMoveFormatStrings, 2,
getter_Copies(logMoveStr));
NS_ENSURE_SUCCESS(rv, rv);
buffer += NS_ConvertUTF16toUTF8(logMoveStr);
--- a/mailnews/base/src/nsStatusBarBiffManager.cpp
+++ b/mailnews/base/src/nsStatusBarBiffManager.cpp
@@ -195,17 +195,17 @@ nsStatusBarBiffManager::OnItemIntPropert
NS_IMETHODIMP
nsStatusBarBiffManager::OnItemBoolPropertyChanged(nsIMsgFolder *item, nsIAtom *property, bool oldValue, bool newValue)
{
return NS_OK;
}
NS_IMETHODIMP
-nsStatusBarBiffManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const PRUnichar *oldValue, const PRUnichar *newValue)
+nsStatusBarBiffManager::OnItemUnicharPropertyChanged(nsIMsgFolder *item, nsIAtom *property, const char16_t *oldValue, const char16_t *newValue)
{
return NS_OK;
}
NS_IMETHODIMP
nsStatusBarBiffManager::OnItemPropertyFlagChanged(nsIMsgDBHdr *item, nsIAtom *property, uint32_t oldFlag, uint32_t newFlag)
{
return NS_OK;
@@ -216,17 +216,17 @@ nsStatusBarBiffManager::OnItemEvent(nsIM
{
return NS_OK;
}
// nsIObserver implementation
NS_IMETHODIMP
nsStatusBarBiffManager::Observe(nsISupports *aSubject,
const char *aTopic,
- const PRUnichar *aData)
+ const char16_t *aData)
{
nsresult rv;
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
bool playSound = false;
rv = pref->GetBoolPref(PREF_CHAT_PLAY_SOUND, &playSound);
NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/src/nsSubscribableServer.cpp
+++ b/mailnews/base/src/nsSubscribableServer.cpp
@@ -370,24 +370,24 @@ nsSubscribableServer::StopPopulating(nsI
NS_IMETHODIMP
nsSubscribableServer::UpdateSubscribed()
{
NS_ASSERTION(false,"override this.");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
-nsSubscribableServer::Subscribe(const PRUnichar *aName)
+nsSubscribableServer::Subscribe(const char16_t *aName)
{
NS_ASSERTION(false,"override this.");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
-nsSubscribableServer::Unsubscribe(const PRUnichar *aName)
+nsSubscribableServer::Unsubscribe(const char16_t *aName)
{
NS_ASSERTION(false,"override this.");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsSubscribableServer::SetShowFullName(bool showFullName)
{
--- a/mailnews/base/src/nsSubscribableServer.h
+++ b/mailnews/base/src/nsSubscribableServer.h
@@ -18,17 +18,17 @@ typedef struct _subscribeTreeNode {
bool isSubscribed;
struct _subscribeTreeNode *prevSibling;
struct _subscribeTreeNode *nextSibling;
struct _subscribeTreeNode *firstChild;
struct _subscribeTreeNode *lastChild;
struct _subscribeTreeNode *parent;
struct _subscribeTreeNode *cachedChild;
#ifdef HAVE_SUBSCRIBE_DESCRIPTION
- PRUnichar *description;
+ char16_t *description;
#endif
#ifdef HAVE_SUBSCRIBE_MESSAGES
uint32_t messages;
#endif
bool isSubscribable;
} SubscribeTreeNode;
#if defined(DEBUG_sspitzer) || defined(DEBUG_seth)
@@ -42,17 +42,17 @@ class nsSubscribableServer : public nsIS
virtual ~nsSubscribableServer();
nsresult Init();
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSISUBSCRIBABLESERVER
private:
- nsresult ConvertNameToUnichar(const char *inStr, PRUnichar **outStr);
+ nsresult ConvertNameToUnichar(const char *inStr, char16_t **outStr);
nsCOMPtr <nsISubscribeListener> mSubscribeListener;
nsCOMPtr <nsIMsgIncomingServer> mIncomingServer;
nsCOMPtr <nsISubscribeDataSource> mSubscribeDS;
char mDelimiter;
bool mShowFullName;
bool mStopped;
nsCOMPtr <nsIRDFResource> kNC_Child;
--- a/mailnews/base/util/Services.cpp
+++ b/mailnews/base/util/Services.cpp
@@ -64,17 +64,17 @@ ShutdownObserver *ShutdownObserver::sShu
return ret.forget(); \
}
#include "mozilla/mailnews/ServiceList.h"
#undef MOZ_SERVICE
NS_IMPL_ISUPPORTS1(ShutdownObserver, nsIObserver)
NS_IMETHODIMP ShutdownObserver::Observe(nsISupports *aSubject,
- const char *aTopic, const PRUnichar *aData)
+ const char *aTopic, const char16_t *aData)
{
if (!strcmp(aTopic, "xpcom-shutdown-threads"))
ShutdownServices();
return NS_OK;
}
void ShutdownObserver::EnsureInitialized()
{
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -83,26 +83,26 @@ static PRTime gtimeOfLastPurgeCheck;
const char *kUseServerRetentionProp = "useServerRetention";
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kCMailDB, NS_MAILDB_CID);
nsICollation * nsMsgDBFolder::gCollationKeyGenerator = nullptr;
-PRUnichar *nsMsgDBFolder::kLocalizedInboxName;
-PRUnichar *nsMsgDBFolder::kLocalizedTrashName;
-PRUnichar *nsMsgDBFolder::kLocalizedSentName;
-PRUnichar *nsMsgDBFolder::kLocalizedDraftsName;
-PRUnichar *nsMsgDBFolder::kLocalizedTemplatesName;
-PRUnichar *nsMsgDBFolder::kLocalizedUnsentName;
-PRUnichar *nsMsgDBFolder::kLocalizedJunkName;
-PRUnichar *nsMsgDBFolder::kLocalizedArchivesName;
-
-PRUnichar *nsMsgDBFolder::kLocalizedBrandShortName;
+char16_t *nsMsgDBFolder::kLocalizedInboxName;
+char16_t *nsMsgDBFolder::kLocalizedTrashName;
+char16_t *nsMsgDBFolder::kLocalizedSentName;
+char16_t *nsMsgDBFolder::kLocalizedDraftsName;
+char16_t *nsMsgDBFolder::kLocalizedTemplatesName;
+char16_t *nsMsgDBFolder::kLocalizedUnsentName;
+char16_t *nsMsgDBFolder::kLocalizedJunkName;
+char16_t *nsMsgDBFolder::kLocalizedArchivesName;
+
+char16_t *nsMsgDBFolder::kLocalizedBrandShortName;
nsrefcnt nsMsgDBFolder::mInstanceCount=0;
NS_IMPL_ISUPPORTS_INHERITED6(nsMsgDBFolder, nsRDFResource,
nsISupportsWeakReference, nsIMsgFolder,
nsIDBChangeListener, nsIUrlListener,
nsIJunkMailClassificationListener,
nsIMsgTraitClassificationListener)
@@ -5153,17 +5153,17 @@ NS_IMETHODIMP
nsMsgDBFolder::GetStringWithFolderNameFromBundle(const char * msgName, nsAString& aResult)
{
nsCOMPtr <nsIStringBundle> bundle;
nsresult rv = GetBaseStringBundle(getter_AddRefs(bundle));
if (NS_SUCCEEDED(rv) && bundle)
{
nsString folderName;
GetName(folderName);
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
folderName.get(),
kLocalizedBrandShortName
};
nsString resultStr;
rv = bundle->FormatStringFromName(NS_ConvertASCIItoUTF16(msgName).get(),
formatStrings, 2, getter_Copies(resultStr));
@@ -5626,31 +5626,31 @@ void nsMsgDBFolder::compressQuotesInMsgS
const nsAString& currentLine = Substring(aMsgSnippet, offset, lineFeedPos - offset);
// this catches quoted text ("> "), nested quotes of any level (">> ", ">>> ", ...)
// it also catches empty line quoted text (">"). It might be over agressive and require
// tweaking later.
// Try to strip the citation. If the current line ends with a ':' and the next line
// looks like a quoted reply (starts with a ">") skip the current line
if (StringBeginsWith(currentLine, NS_LITERAL_STRING(">")) ||
(lineFeedPos + 1 < msgBodyStrLen && lineFeedPos
- && aMsgSnippet[lineFeedPos - 1] == PRUnichar(':')
- && aMsgSnippet[lineFeedPos + 1] == PRUnichar('>')))
+ && aMsgSnippet[lineFeedPos - 1] == char16_t(':')
+ && aMsgSnippet[lineFeedPos + 1] == char16_t('>')))
{
lastLineWasAQuote = true;
}
else if (!currentLine.IsEmpty())
{
if (lastLineWasAQuote)
{
aCompressedQuotes += NS_LITERAL_STRING(" ... ");
lastLineWasAQuote = false;
}
aCompressedQuotes += currentLine;
- aCompressedQuotes += PRUnichar(' '); // don't forget to substitute a space for the line feed
+ aCompressedQuotes += char16_t(' '); // don't forget to substitute a space for the line feed
}
offset = lineFeedPos + 1;
}
else
{
aCompressedQuotes.Append(Substring(aMsgSnippet, offset, msgBodyStrLen - offset));
break;
--- a/mailnews/base/util/nsMsgDBFolder.h
+++ b/mailnews/base/util/nsMsgDBFolder.h
@@ -232,26 +232,26 @@ protected:
bool mInVFEditSearchScope ; // non persistant state used by the virtual folder UI
// static stuff for cross-instance objects like atoms
static NS_MSG_BASE_STATIC_MEMBER_(nsrefcnt) gInstanceCount;
static nsresult initializeStrings();
static nsresult createCollationKeyGenerator();
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedInboxName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedTrashName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedSentName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedDraftsName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedTemplatesName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedUnsentName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedJunkName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedArchivesName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedInboxName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedTrashName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedSentName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedDraftsName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedTemplatesName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedUnsentName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedJunkName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedArchivesName;
- static NS_MSG_BASE_STATIC_MEMBER_(PRUnichar*) kLocalizedBrandShortName;
+ static NS_MSG_BASE_STATIC_MEMBER_(char16_t*) kLocalizedBrandShortName;
#define MSGDBFOLDER_ATOM(name_, value) static NS_MSG_BASE_STATIC_MEMBER_(nsIAtom*) name_;
#include "nsMsgDBFolderAtomList.h"
#undef MSGDBFOLDER_ATOM
static NS_MSG_BASE_STATIC_MEMBER_(nsICollation*) gCollationKeyGenerator;
static const NS_MSG_BASE_STATIC_MEMBER_(nsStaticAtom) folder_atoms[];
--- a/mailnews/base/util/nsMsgI18N.cpp
+++ b/mailnews/base/util/nsMsgI18N.cpp
@@ -60,18 +60,18 @@ nsresult nsMsgI18NConvertFromUnicode(con
if (aIsCharsetCanonical) // optimize for modified UTF-7 used by IMAP
rv = ccm->GetUnicodeEncoderRaw(aCharset, getter_AddRefs(encoder));
else
rv = ccm->GetUnicodeEncoder(aCharset, getter_AddRefs(encoder));
NS_ENSURE_SUCCESS(rv, rv);
rv = encoder->SetOutputErrorBehavior(nsIUnicodeEncoder::kOnError_Replace, nullptr, '?');
NS_ENSURE_SUCCESS(rv, rv);
- const PRUnichar *originalSrcPtr = inString.get();
- const PRUnichar *currentSrcPtr = originalSrcPtr;
+ const char16_t *originalSrcPtr = inString.get();
+ const char16_t *currentSrcPtr = originalSrcPtr;
int32_t originalUnicharLength = inString.Length();
int32_t srcLength;
int32_t dstLength;
char localbuf[512];
int32_t consumedLen = 0;
outString.Truncate();
// convert
@@ -106,17 +106,17 @@ nsresult nsMsgI18NConvertToUnicode(const
// Despite its name, it also works for Latin-1.
CopyASCIItoUTF16(inString, outString);
return NS_OK;
}
else if (!PL_strcasecmp(aCharset, "UTF-8")) {
if (MsgIsUTF8(inString)) {
nsAutoString tmp;
CopyUTF8toUTF16(inString, tmp);
- if (!tmp.IsEmpty() && tmp.get()[0] == PRUnichar(0xFEFF))
+ if (!tmp.IsEmpty() && tmp.get()[0] == char16_t(0xFEFF))
tmp.Cut(0, 1);
outString.Assign(tmp);
return NS_OK;
}
NS_WARNING("Invalid UTF-8 string");
return NS_ERROR_UNEXPECTED;
}
@@ -133,17 +133,17 @@ nsresult nsMsgI18NConvertToUnicode(const
rv = ccm->GetUnicodeDecoderInternal(aCharset, getter_AddRefs(decoder));
NS_ENSURE_SUCCESS(rv, rv);
const char *originalSrcPtr = inString.get();
const char *currentSrcPtr = originalSrcPtr;
int32_t originalLength = inString.Length();
int32_t srcLength;
int32_t dstLength;
- PRUnichar localbuf[512];
+ char16_t localbuf[512];
int32_t consumedLen = 0;
outString.Truncate();
// convert
while (consumedLen < originalLength) {
srcLength = originalLength - consumedLen;
dstLength = 512;
@@ -237,35 +237,35 @@ bool nsMsgI18Nmultibyte_charset(const ch
if (NS_SUCCEEDED(res)) {
result = charsetData.LowerCaseEqualsLiteral("true");
}
}
return result;
}
-bool nsMsgI18Ncheck_data_in_charset_range(const char *charset, const PRUnichar* inString, char **fallbackCharset)
+bool nsMsgI18Ncheck_data_in_charset_range(const char *charset, const char16_t* inString, char **fallbackCharset)
{
if (!charset || !*charset || !inString || !*inString)
return true;
nsresult res;
bool result = true;
nsCOMPtr <nsICharsetConverterManager> ccm = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &res);
if (NS_SUCCEEDED(res)) {
nsCOMPtr <nsIUnicodeEncoder> encoder;
// get an unicode converter
res = ccm->GetUnicodeEncoderRaw(charset, getter_AddRefs(encoder));
if(NS_SUCCEEDED(res)) {
- const PRUnichar *originalPtr = inString;
+ const char16_t *originalPtr = inString;
int32_t originalLen = NS_strlen(inString);
- const PRUnichar *currentSrcPtr = originalPtr;
+ const char16_t *currentSrcPtr = originalPtr;
char localBuff[512];
int32_t consumedLen = 0;
int32_t srcLen;
int32_t dstLength;
// convert from unicode
while (consumedLen < originalLen) {
srcLen = originalLen - consumedLen;
@@ -358,17 +358,17 @@ nsMsgI18NParseMetaCharset(nsIFile* file)
}
}
}
return charset;
}
nsresult nsMsgI18NSaveAsCharset(const char* contentType, const char *charset,
- const PRUnichar* inString, char** outString,
+ const char16_t* inString, char** outString,
char **fallbackCharset, bool *isAsciiOnly)
{
NS_ENSURE_ARG_POINTER(contentType);
NS_ENSURE_ARG_POINTER(charset);
NS_ENSURE_ARG_POINTER(inString);
NS_ENSURE_ARG_POINTER(outString);
*outString = nullptr;
@@ -405,17 +405,17 @@ nsresult nsMsgI18NSaveAsCharset(const ch
// First try to transliterate, if that fails use '?' for "bad" chars.
res = conv->Init(charsetName.get(),
nsISaveAsCharset::attr_FallbackQuestionMark +
nsISaveAsCharset::attr_EntityNone,
nsIEntityConverter::transliterate);
NS_ENSURE_SUCCESS(res, res);
- const PRUnichar *input = inString;
+ const char16_t *input = inString;
// Convert to charset
res = conv->Convert(input, outString);
// If the converer cannot encode to the charset,
// then fallback to pref sepcified charsets.
if (NS_ERROR_UENC_NOMAPPING == res && !bTEXT_HTML && fallbackCharset) {
nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &res));
--- a/mailnews/base/util/nsMsgI18N.h
+++ b/mailnews/base/util/nsMsgI18N.h
@@ -47,17 +47,17 @@ NS_MSG_BASE bool nsMsgI18Nmultibyte_char
* @param inString [IN] Input unicode string to be examined.
* @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.
* @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.
*/
-NS_MSG_BASE bool nsMsgI18Ncheck_data_in_charset_range(const char *charset, const PRUnichar* inString,
+NS_MSG_BASE bool nsMsgI18Ncheck_data_in_charset_range(const char *charset, const char16_t* inString,
char **fallbackCharset=nullptr);
/**
* Return charset name of file system (OS dependent).
*
* @return File system charset name.
*/
NS_MSG_BASE const char * nsMsgI18NFileSystemCharset(void);
@@ -115,17 +115,17 @@ NS_MSG_BASE const char *nsMsgI18NParseMe
* Otherwise, a fallback charset name may be set if that was used for the conversion.
* 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.
* @return nsresult.
*/
NS_MSG_BASE nsresult nsMsgI18NSaveAsCharset(const char* contentType, const char* charset,
- const PRUnichar* inString, char** outString,
+ const char16_t* inString, char** outString,
char **fallbackCharset=nullptr, bool *isAsciiOnly=nullptr);
/**
* Shrink the aStr to aMaxLength bytes. Note that this doesn't check whether
* the aUTF8Str is valid UTF-8 string.
*
* @param inString [IN] Input UTF-8 string (it must be valid UTF-8 string)
* @param aMaxLength [IN] Shrink to this length (it means bytes)
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -779,17 +779,17 @@ nsMsgIncomingServer::GetPasswordWithUI(c
rv = GetHostName(temp);
NS_ENSURE_SUCCESS(rv, rv);
serverUri.Append(temp);
// we pass in the previously used password, if any, into PromptPassword
// so that it will appear as ******. This means we can't use an nsString
// and getter_Copies.
- PRUnichar *uniPassword = nullptr;
+ char16_t *uniPassword = nullptr;
if (!aPassword.IsEmpty())
uniPassword = ToNewUnicode(NS_ConvertASCIItoUTF16(aPassword));
bool okayValue = true;
rv = dialog->PromptPassword(PromiseFlatString(aPromptTitle).get(),
PromiseFlatString(aPromptMessage).get(),
NS_ConvertASCIItoUTF16(serverUri).get(),
nsIAuthPrompt::SAVE_PASSWORD_PERMANENTLY,
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -615,17 +615,17 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetFileB
{
return m_baseURL->SetFileBaseName(aFileBaseName);
}
NS_IMETHODIMP nsMsgMailNewsUrl::GetFileExtension(nsACString &aFileExtension)
{
if (!mAttachmentFileName.IsEmpty())
{
- int32_t pos = mAttachmentFileName.RFindChar(PRUnichar('.'));
+ int32_t pos = mAttachmentFileName.RFindChar(char16_t('.'));
if (pos > 0)
aFileExtension = Substring(mAttachmentFileName, pos + 1 /* skip the '.' */);
return NS_OK;
}
return m_baseURL->GetFileExtension(aFileExtension);
}
NS_IMETHODIMP nsMsgMailNewsUrl::SetFileExtension(const nsACString &aFileExtension)
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -41,17 +41,17 @@
#undef PostMessage // avoid to collision with WinUser.h
using namespace mozilla;
NS_IMPL_ISUPPORTS5(nsMsgProtocol, nsIChannel, nsIStreamListener,
nsIRequestObserver, nsIRequest, nsITransportEventSink)
-static PRUnichar *FormatStringWithHostNameByID(int32_t stringID, nsIMsgMailNewsUrl *msgUri);
+static char16_t *FormatStringWithHostNameByID(int32_t stringID, nsIMsgMailNewsUrl *msgUri);
nsMsgProtocol::nsMsgProtocol(nsIURI * aURL)
{
m_flags = 0;
m_readCount = 0;
mLoadFlags = 0;
m_socketIsOpen = false;
@@ -1526,41 +1526,41 @@ void nsMsgAsyncWriteProtocol::UpdateProg
}
nsresult nsMsgAsyncWriteProtocol::SendData(const char * dataBuffer, bool aSuppressLogging)
{
this->mAsyncBuffer.Append(dataBuffer);
return mAsyncOutStream->AsyncWait(mProvider, 0, 0, mProviderThread);
}
-PRUnichar *FormatStringWithHostNameByID(int32_t stringID, nsIMsgMailNewsUrl *msgUri)
+char16_t *FormatStringWithHostNameByID(int32_t stringID, nsIMsgMailNewsUrl *msgUri)
{
if (!msgUri)
return nullptr;
nsresult rv;
nsCOMPtr<nsIStringBundleService> sBundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(sBundleService, nullptr);
nsCOMPtr<nsIStringBundle> sBundle;
rv = sBundleService->CreateBundle(MSGS_URL, getter_AddRefs(sBundle));
NS_ENSURE_SUCCESS(rv, nullptr);
- PRUnichar *ptrv = nullptr;
+ char16_t *ptrv = nullptr;
nsCOMPtr<nsIMsgIncomingServer> server;
rv = msgUri->GetServer(getter_AddRefs(server));
NS_ENSURE_SUCCESS(rv, nullptr);
nsCString hostName;
rv = server->GetRealHostName(hostName);
NS_ENSURE_SUCCESS(rv, nullptr);
NS_ConvertASCIItoUTF16 hostStr(hostName);
- const PRUnichar *params[] = { hostStr.get() };
+ const char16_t *params[] = { hostStr.get() };
rv = sBundle->FormatStringFromID(stringID, params, 1, &ptrv);
NS_ENSURE_SUCCESS(rv, nullptr);
return ptrv;
}
// vim: ts=2 sw=2
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -333,17 +333,17 @@ MsgFindCharInSet(const nsCString &aStrin
int32_t
MsgFindCharInSet(const nsString &aString,
const char* aChars, uint32_t aOffset)
{
#ifdef MOZILLA_INTERNAL_API
return aString.FindCharInSet(aChars, aOffset);
#else
- const PRUnichar *str;
+ const char16_t *str;
uint32_t len = aString.BeginReading(&str);
int filter = GetFindInSetFilter(aChars);
for (uint32_t index = aOffset; index < len; index++) {
if (!(str[index] & filter) && strchr(aChars, str[index]))
return index;
}
return -1;
#endif
@@ -474,17 +474,17 @@ nsresult NS_MsgHashIfNecessary(nsAutoStr
nsresult FormatFileSize(uint64_t size, bool useKB, nsAString &formattedSize)
{
NS_NAMED_LITERAL_STRING(byteAbbr, "byteAbbreviation2");
NS_NAMED_LITERAL_STRING(kbAbbr, "kiloByteAbbreviation2");
NS_NAMED_LITERAL_STRING(mbAbbr, "megaByteAbbreviation2");
NS_NAMED_LITERAL_STRING(gbAbbr, "gigaByteAbbreviation2");
- const PRUnichar *sizeAbbrNames[] = {
+ const char16_t *sizeAbbrNames[] = {
byteAbbr.get(), kbAbbr.get(), mbAbbr.get(), gbAbbr.get()
};
nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleSvc =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleSvc, NS_ERROR_UNEXPECTED);
@@ -1791,33 +1791,33 @@ NS_MSG_BASE char *MsgEscapeHTML(const ch
*ptr++ = *string;
}
}
*ptr = '\0';
}
return(rv);
}
-NS_MSG_BASE PRUnichar *MsgEscapeHTML2(const PRUnichar *aSourceBuffer,
+NS_MSG_BASE char16_t *MsgEscapeHTML2(const char16_t *aSourceBuffer,
int32_t aSourceBufferLen)
{
// if the caller didn't calculate the length
if (aSourceBufferLen == -1) {
aSourceBufferLen = NS_strlen(aSourceBuffer); // ...then I will
}
/* XXX Hardcoded max entity len. */
if (aSourceBufferLen >=
- ((PR_UINT32_MAX - sizeof(PRUnichar)) / (6 * sizeof(PRUnichar))) )
+ ((PR_UINT32_MAX - sizeof(char16_t)) / (6 * sizeof(char16_t))) )
return nullptr;
- PRUnichar *resultBuffer = (PRUnichar *)nsMemory::Alloc(aSourceBufferLen *
- 6 * sizeof(PRUnichar) + sizeof(PRUnichar('\0')));
+ char16_t *resultBuffer = (char16_t *)nsMemory::Alloc(aSourceBufferLen *
+ 6 * sizeof(char16_t) + sizeof(char16_t('\0')));
- PRUnichar *ptr = resultBuffer;
+ char16_t *ptr = resultBuffer;
if (resultBuffer) {
int32_t i;
for(i = 0; i < aSourceBufferLen; i++) {
if(aSourceBuffer[i] == '<') {
*ptr++ = '&';
*ptr++ = 'l';
@@ -1889,19 +1889,19 @@ NS_MSG_BASE void MsgCompressWhitespace(n
*m = *(m + wlen);
}
}
// Set the new length.
aString.SetLength(end - start);
}
-NS_MSG_BASE void MsgReplaceChar(nsString& str, const char *set, const PRUnichar replacement)
+NS_MSG_BASE void MsgReplaceChar(nsString& str, const char *set, const char16_t replacement)
{
- PRUnichar *c_str = str.BeginWriting();
+ char16_t *c_str = str.BeginWriting();
while (*set) {
int32_t pos = 0;
while ((pos = str.FindChar(*set, pos)) != -1) {
c_str[pos++] = replacement;
}
set++;
}
}
@@ -1932,17 +1932,17 @@ NS_MSG_BASE nsIAtom* MsgNewPermanentAtom
if (atomService)
atomService->GetPermanentAtomUTF8(aString, &atom);
return atom;
}
NS_MSG_BASE void MsgReplaceSubstring(nsAString &str, const nsAString &what, const nsAString &replacement)
{
- const PRUnichar* replacement_str;
+ const char16_t* replacement_str;
uint32_t replacementLength = replacement.BeginReading(&replacement_str);
uint32_t whatLength = what.Length();
int32_t i = 0;
while ((i = str.Find(what, i)) != kNotFound)
{
str.Replace(i, whatLength, replacement_str, replacementLength);
i += replacementLength;
@@ -2126,17 +2126,17 @@ NS_MSG_BASE nsresult MsgPromptLoginFaile
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleSvc->CreateBundle("chrome://messenger/locale/messenger.properties",
getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
nsString message;
NS_ConvertUTF8toUTF16 hostNameUTF16(aHostname);
- const PRUnichar *formatStrings[] = { hostNameUTF16.get() };
+ const char16_t *formatStrings[] = { hostNameUTF16.get() };
rv = bundle->FormatStringFromName(MOZ_UTF16("mailServerLoginFailed"),
formatStrings, 1,
getter_Copies(message));
NS_ENSURE_SUCCESS(rv, rv);
nsString title;
rv = bundle->GetStringFromName(
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -423,33 +423,33 @@ inline int32_t MsgFind(nsACString &str,
/// Equivalent of RFindChar(ch, len)
#define MsgRFindChar(str, ch, len) \
StringHead(str, len).RFindChar(ch)
/// Equivalent of aString.CompressWhitespace()
NS_MSG_BASE void MsgCompressWhitespace(nsCString& aString);
/// Equivalent of nsEscapeHTML(aString)
NS_MSG_BASE char *MsgEscapeHTML(const char *aString);
/// Equivalent of nsEscapeHTML2(aBuffer, aLen)
-NS_MSG_BASE PRUnichar *MsgEscapeHTML2(const PRUnichar *aBuffer, int32_t aLen);
+NS_MSG_BASE char16_t *MsgEscapeHTML2(const char16_t *aBuffer, int32_t aLen);
// Existing replacement for IsUTF8
NS_MSG_BASE bool MsgIsUTF8(const nsACString& aString);
/// Equivalent of NS_NewAtom(aUTF8String)
NS_MSG_BASE already_AddRefed<nsIAtom> MsgNewAtom(const char* aString);
/// Replacement of NS_RegisterStaticAtoms
NS_MSG_BASE nsIAtom* MsgNewPermanentAtom(const char* aString);
/// Equivalent of do_GetAtom(aUTF8String)
inline already_AddRefed<nsIAtom> MsgGetAtom(const char* aUTF8String)
{
return MsgNewAtom(aUTF8String);
}
/// Equivalent of ns(C)String::ReplaceSubstring(what, replacement)
NS_MSG_BASE void MsgReplaceSubstring(nsAString &str, const nsAString &what, const nsAString &replacement);
NS_MSG_BASE void MsgReplaceSubstring(nsACString &str, const char *what, const char *replacement);
/// Equivalent of ns(C)String::ReplaceChar(what, replacement)
-NS_MSG_BASE void MsgReplaceChar(nsString& str, const char *set, const PRUnichar replacement);
+NS_MSG_BASE void MsgReplaceChar(nsString& str, const char *set, const char16_t replacement);
NS_MSG_BASE void MsgReplaceChar(nsCString& str, const char needle, const char replacement);
// Equivalent of NS_NewInterfaceRequestorAggregation(aFirst, aSecond, aResult)
NS_MSG_BASE nsresult MsgNewInterfaceRequestorAggregation(nsIInterfaceRequestor *aFirst,
nsIInterfaceRequestor *aSecond,
nsIInterfaceRequestor **aResult);
/**
* This function is based on NS_NewNotificationCallbacksAggregation from
@@ -499,33 +499,33 @@ do_QueryElementAt( nsISupportsArray* arr
{
return MsgQueryElementAt(array, aIndex, aErrorPtr);
}
/**
* Count occurences of specified character in string.
*
*/
inline
-uint32_t MsgCountChar(nsACString &aString, PRUnichar aChar) {
+uint32_t MsgCountChar(nsACString &aString, char16_t aChar) {
const char *begin, *end;
uint32_t num_chars = 0;
aString.BeginReading(&begin, &end);
for (const char *current = begin; current < end; ++current) {
if (*current == aChar)
++num_chars;
}
return num_chars;
}
inline
-uint32_t MsgCountChar(nsAString &aString, PRUnichar aChar) {
- const PRUnichar *begin, *end;
+uint32_t MsgCountChar(nsAString &aString, char16_t aChar) {
+ const char16_t *begin, *end;
uint32_t num_chars = 0;
aString.BeginReading(&begin, &end);
- for (const PRUnichar *current = begin; current < end; ++current) {
+ for (const char16_t *current = begin; current < end; ++current) {
if (*current == aChar)
++num_chars;
}
return num_chars;
}
#endif
--- a/mailnews/compose/public/nsIURLFetcher.idl
+++ b/mailnews/compose/public/nsIURLFetcher.idl
@@ -12,17 +12,17 @@
//
// Callback declarations for URL completion
//
// For completion of send/message creation operations...
typedef nsresult (*nsAttachSaveCompletionCallback) (nsresult aStatus,
const nsACString &aContentType,
const nsACString &aCharset,
- int32_t totalSize, const PRUnichar* aMsg,
+ int32_t totalSize, const char16_t* aMsg,
void *tagData);
class nsMsgAttachmentHandler;
%}
native nsAttachSaveCompletionCallback(nsAttachSaveCompletionCallback);
[ptr] native nsMsgAttachmentHandler(nsMsgAttachmentHandler);
--- a/mailnews/compose/src/nsMsgAttachmentHandler.cpp
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.cpp
@@ -436,17 +436,17 @@ nsMsgAttachmentHandler::PickCharset()
return MsgDetectCharsetFromFile(tmpFile, m_charset);
}
static nsresult
FetcherURLDoneCallback(nsresult aStatus,
const nsACString &aContentType,
const nsACString &aCharset,
int32_t totalSize,
- const PRUnichar* aMsg, void *tagData)
+ const char16_t* aMsg, void *tagData)
{
nsMsgAttachmentHandler *ma = (nsMsgAttachmentHandler *) tagData;
NS_ASSERTION(ma != nullptr, "not-null mime attachment");
if (ma != nullptr)
{
ma->m_size = totalSize;
if (!aContentType.IsEmpty())
@@ -980,17 +980,17 @@ nsMsgAttachmentHandler::Abort()
m_mime_delivery_state->SetStatus(NS_ERROR_ABORT);
m_mime_delivery_state->NotifyListenerOnStopSending(nullptr, NS_ERROR_ABORT, 0, nullptr);
}
return NS_OK;
}
nsresult
-nsMsgAttachmentHandler::UrlExit(nsresult status, const PRUnichar* aMsg)
+nsMsgAttachmentHandler::UrlExit(nsresult status, const char16_t* aMsg)
{
NS_ASSERTION(m_mime_delivery_state != nullptr, "not-null m_mime_delivery_state");
// Close the file, but don't delete the disk file (or the file spec.)
if (mOutFile)
{
mOutFile->Close();
mOutFile = nullptr;
@@ -1025,17 +1025,17 @@ nsMsgAttachmentHandler::UrlExit(nsresult
if (NS_FAILED(status) && status != NS_ERROR_ABORT && NS_SUCCEEDED(mimeDeliveryStatus))
{
// At this point, we should probably ask a question to the user
// if we should continue without this attachment.
//
bool keepOnGoing = true;
nsCString turl;
nsString msg;
- PRUnichar *printfString = nullptr;
+ char16_t *printfString = nullptr;
nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
nsMsgDeliverMode mode = nsIMsgSend::nsMsgDeliverNow;
--- a/mailnews/compose/src/nsMsgAttachmentHandler.h
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.h
@@ -72,17 +72,17 @@ public:
public:
nsresult SnarfAttachment(nsMsgCompFields *compFields);
nsresult PickEncoding(const char *charset, nsIMsgSend* mime_delivery_state);
nsresult PickCharset();
void AnalyzeSnarfedFile (); // Analyze a previously-snarfed file.
// (Currently only used for plaintext
// converted from HTML.)
nsresult Abort();
- nsresult UrlExit(nsresult status, const PRUnichar* aMsg);
+ nsresult UrlExit(nsresult status, const char16_t* aMsg);
// if there's an intermediate temp file left, takes care to remove it from disk.
//
// NOTE: this takes care of the mEncodedWorkingFile temp file, but not mTmpFile which seems
// to be used by lots of other classes at the moment.
void CleanupTempFile();
private:
--- a/mailnews/compose/src/nsMsgCompFields.cpp
+++ b/mailnews/compose/src/nsMsgCompFields.cpp
@@ -502,33 +502,33 @@ NS_IMETHODIMP nsMsgCompFields::RemoveAtt
}
// This method is called during the creation of a new window.
NS_IMETHODIMP
nsMsgCompFields::SplitRecipients(const nsAString &aRecipients,
bool aEmailAddressOnly,
uint32_t *aLength,
- PRUnichar*** aResult)
+ char16_t*** aResult)
{
NS_ENSURE_ARG_POINTER(aLength);
NS_ENSURE_ARG_POINTER(aResult);
*aLength = 0;
*aResult = nullptr;
ParsedHeader header(EncodedHeader(NS_ConvertUTF16toUTF8(aRecipients)));
nsTArray<nsString> results;
if (aEmailAddressOnly)
ExtractEmails(header, results);
else
ExtractDisplayAddresses(header, results);
uint32_t count = results.Length();
- PRUnichar **result = (PRUnichar **)NS_Alloc(sizeof(PRUnichar *) * count);
+ char16_t **result = (char16_t **)NS_Alloc(sizeof(char16_t *) * count);
for (uint32_t i = 0; i < count; ++i)
result[i] = ToNewUnicode(results[i]);
*aResult = result;
*aLength = count;
return NS_OK;
}
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -1578,17 +1578,17 @@ msg_make_filename_qtext(const char *srcT
*d = 0;
return newString;
}
/* Rip apart the URL and extract a reasonable value for the `real_name' slot.
*/
void
-msg_pick_real_name (nsMsgAttachmentHandler *attachment, const PRUnichar *proposedName, const char *charset)
+msg_pick_real_name (nsMsgAttachmentHandler *attachment, const char16_t *proposedName, const char *charset)
{
const char *s, *s2;
if (!attachment->m_realName.IsEmpty())
return;
if (proposedName && *proposedName)
{
--- a/mailnews/compose/src/nsMsgCompUtils.h
+++ b/mailnews/compose/src/nsMsgCompUtils.h
@@ -102,17 +102,17 @@ char *mime_fix_addr_header (const
char *mime_fix_news_header (const char *string);
bool mime_type_requires_b64_p (const char *type);
bool mime_type_needs_charset (const char *type);
char *msg_make_filename_qtext(const char *srcText, bool stripCRLFs);
// Rip apart the URL and extract a reasonable value for the `real_name' slot.
-void msg_pick_real_name (nsMsgAttachmentHandler *attachment, const PRUnichar *proposedName, const char *charset);
+void msg_pick_real_name (nsMsgAttachmentHandler *attachment, const char16_t *proposedName, const char *charset);
//
// Informational calls...
//
void nsMsgMIMESetConformToStandard (bool conform_p);
bool nsMsgMIMEGetConformToStandard (void);
//
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -103,20 +103,20 @@ static void GetReplyHeaderInfo(int32_t*
NS_GetUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_separator", NS_LITERAL_STRING(", "), reply_header_separator);
NS_GetUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_colon", NS_LITERAL_STRING(":"), reply_header_colon);
NS_GetLocalizedUnicharPreferenceWithDefault(prefBranch, "mailnews.reply_header_originalmessage", NS_LITERAL_STRING("--- Original Message ---"), reply_header_originalmessage);
}
}
static void TranslateLineEnding(nsString& data)
{
- PRUnichar* rPtr; //Read pointer
- PRUnichar* wPtr; //Write pointer
- PRUnichar* sPtr; //Start data pointer
- PRUnichar* ePtr; //End data pointer
+ char16_t* rPtr; //Read pointer
+ char16_t* wPtr; //Write pointer
+ char16_t* sPtr; //Start data pointer
+ char16_t* ePtr; //End data pointer
rPtr = wPtr = sPtr = data.BeginWriting();
ePtr = rPtr + data.Length();
while (rPtr < ePtr)
{
if (*rPtr == nsCRT::CR) {
*wPtr = nsCRT::LF;
@@ -2254,17 +2254,17 @@ QuotingOutputStreamListener::QuotingOutp
kDateFormatShort,
kTimeFormatNoSeconds,
originalMsgDate,
formattedDateString);
if (NS_SUCCEEDED(rv))
{
// take care "On %s"
- PRUnichar *formatedString = nullptr;
+ char16_t *formatedString = nullptr;
formatedString = nsTextFormatter::smprintf(replyHeaderOndate.get(),
NS_ConvertUTF16toUTF8(formattedDateString.get()).get());
if (formatedString)
{
citePrefixDate.Assign(formatedString);
nsTextFormatter::smprintf_free(formatedString);
}
}
@@ -2277,17 +2277,17 @@ QuotingOutputStreamListener::QuotingOutp
nsAutoCString author;
rv = originalMsgHdr->GetAuthor(getter_Copies(author));
if (NS_SUCCEEDED(rv))
{
nsAutoCString authorName;
ExtractName(EncodedHeader(author), authorName);
- PRUnichar *formattedString = nullptr;
+ char16_t *formattedString = nullptr;
formattedString = nsTextFormatter::smprintf(
replyHeaderAuthorwrote.get(), authorName.get());
if (formattedString)
{
citePrefixAuthor.Assign(formattedString);
nsTextFormatter::smprintf_free(formattedString);
}
}
@@ -2693,17 +2693,17 @@ NS_IMETHODIMP QuotingOutputStreamListene
if (type == nsIMsgCompType::Reply)
{
compFields->SetTo(EmptyString());
}
}
}
if (!references.IsEmpty())
- references.Append(PRUnichar(' '));
+ references.Append(char16_t(' '));
references += messageId;
compFields->SetReferences(NS_LossyConvertUTF16toASCII(references).get());
nsAutoCString resultStr;
// Cast interface to concrete class that has direct field getters etc.
nsMsgCompFields* _compFields = static_cast<nsMsgCompFields*>(compFields.get());
@@ -2861,57 +2861,57 @@ NS_IMETHODIMP QuotingOutputStreamListene
{
int32_t unicharLength;
int32_t inputLength = inStr.Length();
rv = mUnicodeDecoder->GetMaxLength(inStr.get(), inStr.Length(), &unicharLength);
if (NS_SUCCEEDED(rv))
{
// Use this local buffer if possible.
const int32_t kLocalBufSize = 4096;
- PRUnichar localBuf[kLocalBufSize];
- PRUnichar *unichars = localBuf;
+ char16_t localBuf[kLocalBufSize];
+ char16_t *unichars = localBuf;
if (unicharLength > kLocalBufSize)
{
// Otherwise, use the buffer of the class.
if (!mUnicodeConversionBuffer ||
unicharLength > mUnicodeBufferCharacterLength)
{
if (mUnicodeConversionBuffer)
nsMemory::Free(mUnicodeConversionBuffer);
- mUnicodeConversionBuffer = (PRUnichar *) nsMemory::Alloc(unicharLength * sizeof(PRUnichar));
+ mUnicodeConversionBuffer = (char16_t *) nsMemory::Alloc(unicharLength * sizeof(char16_t));
if (!mUnicodeConversionBuffer)
{
mUnicodeBufferCharacterLength = 0;
return NS_ERROR_OUT_OF_MEMORY;
}
mUnicodeBufferCharacterLength = unicharLength;
}
unichars = mUnicodeConversionBuffer;
}
int32_t consumedInputLength = 0;
int32_t originalInputLength = inputLength;
const char *inputBuffer = inStr.get();
int32_t convertedOutputLength = 0;
int32_t outputBufferLength = unicharLength;
- PRUnichar *originalOutputBuffer = unichars;
+ char16_t *originalOutputBuffer = unichars;
do
{
rv = mUnicodeDecoder->Convert(inputBuffer, &inputLength, unichars, &unicharLength);
if (NS_SUCCEEDED(rv))
{
convertedOutputLength += unicharLength;
break;
}
// if we failed, we consume one byte, replace it with a question mark
// and try the conversion again.
unichars += unicharLength;
- *unichars = (PRUnichar)'?';
+ *unichars = (char16_t)'?';
unichars++;
unicharLength++;
mUnicodeDecoder->Reset();
inputBuffer += ++inputLength;
consumedInputLength += inputLength;
inputLength = originalInputLength - consumedInputLength; // update input length to convert
@@ -3130,17 +3130,17 @@ nsMsgCompose::QuoteOriginalMessage() //
//CleanUpRecipient will remove un-necessary "<>" when a recipient as an address without name
void nsMsgCompose::CleanUpRecipients(nsString& recipients)
{
uint16_t i;
bool startANewRecipient = true;
bool removeBracket = false;
nsAutoString newRecipient;
- PRUnichar aChar;
+ char16_t aChar;
for (i = 0; i < recipients.Length(); i ++)
{
aChar = recipients[i];
switch (aChar)
{
case '<' :
if (startANewRecipient)
@@ -3338,30 +3338,30 @@ NS_IMETHODIMP nsMsgCompose::OnProgress(c
while (iter.HasMore())
{
externalSendListener = iter.GetNext();
externalSendListener->OnProgress(aMsgID, aProgress, aProgressMax);
}
return NS_OK;
}
-NS_IMETHODIMP nsMsgCompose::OnStatus(const char *aMsgID, const PRUnichar *aMsg)
+NS_IMETHODIMP nsMsgCompose::OnStatus(const char *aMsgID, const char16_t *aMsg)
{
nsTObserverArray<nsCOMPtr<nsIMsgSendListener> >::ForwardIterator iter(mExternalSendListeners);
nsCOMPtr<nsIMsgSendListener> externalSendListener;
while (iter.HasMore())
{
externalSendListener = iter.GetNext();
externalSendListener->OnStatus(aMsgID, aMsg);
}
return NS_OK;
}
-NS_IMETHODIMP nsMsgCompose::OnStopSending(const char *aMsgID, nsresult aStatus, const PRUnichar *aMsg,
+NS_IMETHODIMP nsMsgCompose::OnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg,
nsIFile *returnFile)
{
nsTObserverArray<nsCOMPtr<nsIMsgSendListener> >::ForwardIterator iter(mExternalSendListeners);
nsCOMPtr<nsIMsgSendListener> externalSendListener;
while (iter.HasMore())
{
externalSendListener = iter.GetNext();
@@ -3459,17 +3459,17 @@ nsMsgComposeSendListener::OnProgress(con
nsresult rv;
nsCOMPtr<nsIMsgSendListener> composeSendListener = do_QueryReferent(mWeakComposeObj, &rv);
if (NS_SUCCEEDED(rv) && composeSendListener)
composeSendListener->OnProgress(aMsgID, aProgress, aProgressMax);
return NS_OK;
}
nsresult
-nsMsgComposeSendListener::OnStatus(const char *aMsgID, const PRUnichar *aMsg)
+nsMsgComposeSendListener::OnStatus(const char *aMsgID, const char16_t *aMsg)
{
nsresult rv;
nsCOMPtr<nsIMsgSendListener> composeSendListener = do_QueryReferent(mWeakComposeObj, &rv);
if (NS_SUCCEEDED(rv) && composeSendListener)
composeSendListener->OnStatus(aMsgID, aMsg);
return NS_OK;
}
@@ -3487,17 +3487,17 @@ nsresult nsMsgComposeSendListener::OnSen
nsCOMPtr<nsIMsgSendListener> composeSendListener = do_QueryReferent(mWeakComposeObj, &rv);
if (NS_SUCCEEDED(rv) && composeSendListener)
composeSendListener->OnSendNotPerformed(aMsgID, aStatus);
return rv;
}
nsresult nsMsgComposeSendListener::OnStopSending(const char *aMsgID, nsresult aStatus,
- const PRUnichar *aMsg, nsIFile *returnFile)
+ const char16_t *aMsg, nsIFile *returnFile)
{
nsresult rv = NS_OK;
nsCOMPtr<nsIMsgCompose> msgCompose = do_QueryReferent(mWeakComposeObj, &rv);
if (msgCompose)
{
nsCOMPtr<nsIMsgProgress> progress;
msgCompose->GetProgress(getter_AddRefs(progress));
@@ -3878,17 +3878,17 @@ NS_IMETHODIMP nsMsgComposeSendListener::
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location, in unsigned long aFlags); */
NS_IMETHODIMP nsMsgComposeSendListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location, uint32_t aFlags)
{
/* Ignore this call */
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
-NS_IMETHODIMP nsMsgComposeSendListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
+NS_IMETHODIMP nsMsgComposeSendListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const char16_t *aMessage)
{
/* Ignore this call */
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsMsgComposeSendListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, uint32_t state)
{
@@ -3917,17 +3917,17 @@ nsMsgCompose::ConvertTextToHTML(nsIFile
rv = LoadDataFromFile(aSigFile, origBuf);
if (NS_FAILED(rv))
return rv;
// Ok, once we are here, we need to escape the data to make sure that
// we don't do HTML stuff with plain text sigs.
//
- PRUnichar *escaped = MsgEscapeHTML2(origBuf.get(), origBuf.Length());
+ char16_t *escaped = MsgEscapeHTML2(origBuf.get(), origBuf.Length());
if (escaped)
{
aSigData.Append(escaped);
NS_Free(escaped);
}
else
aSigData.Append(origBuf);
return NS_OK;
@@ -4194,17 +4194,17 @@ nsMsgCompose::ProcessSignature(nsIMsgIde
if (htmlSig)
ConvertBufToPlainText(prefSigText, false, true);
sigData.Append(prefSigText);
}
else
{
if (!htmlSig)
{
- PRUnichar* escaped = MsgEscapeHTML2(prefSigText.get(), prefSigText.Length());
+ char16_t* escaped = MsgEscapeHTML2(prefSigText.get(), prefSigText.Length());
if (escaped)
{
sigData.Append(escaped);
NS_Free(escaped);
}
else
sigData.Append(prefSigText);
}
@@ -4718,17 +4718,17 @@ nsMsgCompose::CheckAndPopulateRecipients
{
if (!newRecipient.mEmail.IsEmpty())
newRecipient.mAddress += newRecipient.mEmail;
else
newRecipient.mAddress += pDisplayName;
}
else
newRecipient.mAddress += newRecipient.mEmail;
- newRecipient.mAddress.Append(PRUnichar('>'));
+ newRecipient.mAddress.Append(char16_t('>'));
}
if (newRecipient.mAddress.IsEmpty())
continue;
// Now we need to insert the new address into the list of
// recipient
if (bIsMailList)
@@ -4880,25 +4880,25 @@ nsMsgCompose::CheckAndPopulateRecipients
default: // nsIAbPreferMailFormat::unknown
atLeastOneRecipientPrefersUnknown = true;
break;
}
if (aPopulateMailList)
{
if (!recipientsStr.IsEmpty())
- recipientsStr.Append(PRUnichar(','));
+ recipientsStr.Append(char16_t(','));
recipientsStr.Append(recipient.mAddress);
}
if (aReturnNonHTMLRecipients &&
recipient.mPreferFormat != nsIAbPreferMailFormat::html)
{
if (!nonHtmlRecipientsStr.IsEmpty())
- nonHtmlRecipientsStr.Append(PRUnichar(','));
+ nonHtmlRecipientsStr.Append(char16_t(','));
nonHtmlRecipientsStr.Append(recipient.mEmail);
}
}
if (aPopulateMailList)
{
switch (i)
{
@@ -5372,13 +5372,13 @@ nsMsgMailList::nsMsgMailList(nsIAbDirect
{
//oops, parser problem! I will try to do my best...
mFullName = listName;
mFullName.AppendLiteral(" <");
if (listDescription.IsEmpty())
mFullName += listName;
else
mFullName += listDescription;
- mFullName.Append(PRUnichar('>'));
+ mFullName.Append(char16_t('>'));
}
mDirectory = directory;
}
--- a/mailnews/compose/src/nsMsgCompose.h
+++ b/mailnews/compose/src/nsMsgCompose.h
@@ -169,17 +169,17 @@ private:
bool mHeadersOnly;
nsCOMPtr<nsIMimeHeaders> mHeaders;
nsCOMPtr<nsIMsgIdentity> mIdentity;
nsCOMPtr<nsIMsgDBHdr> mOrigMsgHdr;
nsString mCiteReference;
nsCOMPtr<nsIMimeConverter> mMimeConverter;
nsCOMPtr<nsIUnicodeDecoder> mUnicodeDecoder;
int32_t mUnicodeBufferCharacterLength;
- PRUnichar* mUnicodeConversionBuffer;
+ char16_t* mUnicodeConversionBuffer;
bool mQuoteOriginal;
nsCString mHtmlToQuote;
};
////////////////////////////////////////////////////////////////////////////////////
// This is the listener class for the send operation. We have to create this class
// to listen for message send completion and eventually notify the caller
////////////////////////////////////////////////////////////////////////////////////
--- a/mailnews/compose/src/nsMsgComposeProgressParams.cpp
+++ b/mailnews/compose/src/nsMsgComposeProgressParams.cpp
@@ -13,24 +13,24 @@ nsMsgComposeProgressParams::nsMsgCompose
{
}
nsMsgComposeProgressParams::~nsMsgComposeProgressParams()
{
}
/* attribute wstring subject; */
-NS_IMETHODIMP nsMsgComposeProgressParams::GetSubject(PRUnichar * *aSubject)
+NS_IMETHODIMP nsMsgComposeProgressParams::GetSubject(char16_t * *aSubject)
{
NS_ENSURE_ARG(aSubject);
*aSubject = ToNewUnicode(m_subject);
return NS_OK;
}
-NS_IMETHODIMP nsMsgComposeProgressParams::SetSubject(const PRUnichar * aSubject)
+NS_IMETHODIMP nsMsgComposeProgressParams::SetSubject(const char16_t * aSubject)
{
m_subject = aSubject;
return NS_OK;
}
/* attribute MSG_DeliverMode deliveryMode; */
NS_IMETHODIMP nsMsgComposeProgressParams::GetDeliveryMode(MSG_DeliverMode *aDeliveryMode)
{
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -320,17 +320,17 @@ void nsMsgComposeService::CloseHiddenCac
}
}
}
}
}
}
NS_IMETHODIMP
-nsMsgComposeService::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
+nsMsgComposeService::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData)
{
if (!strcmp(aTopic, "profile-do-change") || !strcmp(aTopic, "quit-application"))
{
DeleteCachedWindows();
return NS_OK;
}
if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID))
@@ -447,25 +447,25 @@ nsMsgComposeService::GetOrigWindowSelect
if (selPlain.IsEmpty())
return NS_ERROR_ABORT;
nsCOMPtr<nsILineBreaker> lineBreaker = do_GetService(NS_LBRK_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv))
{
const uint32_t length = selPlain.Length();
- const PRUnichar* unicodeStr = selPlain.get();
+ const char16_t* unicodeStr = selPlain.get();
int32_t endWordPos = lineBreaker->Next(unicodeStr, length, 0);
// If there's not even one word, then there's not multiple words
if (endWordPos == NS_LINEBREAKER_NEED_MORE_TEXT)
return NS_ERROR_ABORT;
// If after the first word is only space, then there's not multiple words
- const PRUnichar* end;
+ const char16_t* end;
for (end = unicodeStr + endWordPos; NS_IsSpace(*end); end++)
;
if (!*end)
return NS_ERROR_ABORT;
}
}
if (!charsOnlyIf.IsEmpty())
--- a/mailnews/compose/src/nsMsgPrompts.cpp
+++ b/mailnews/compose/src/nsMsgPrompts.cpp
@@ -42,65 +42,65 @@ nsMsgGetMessageByName(const nsString &aN
rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
return bundle->GetStringFromName(aName.get(),
getter_Copies(aResult));
}
static nsresult
-nsMsgBuildMessageByName(const PRUnichar *aName, nsIFile *aFile, nsString& aResult)
+nsMsgBuildMessageByName(const char16_t *aName, nsIFile *aFile, nsString& aResult)
{
NS_ENSURE_ARG_POINTER(aFile);
nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
nsString path;
aFile->GetPath(path);
- const PRUnichar *params[1] = {path.get()};
+ const char16_t *params[1] = {path.get()};
return bundle->FormatStringFromName(aName, params, 1, getter_Copies(aResult));
}
nsresult
nsMsgBuildMessageWithFile(nsIFile *aFile, nsString& aResult)
{
return nsMsgBuildMessageByName(MOZ_UTF16("unableToOpenFile"), aFile, aResult);
}
nsresult
nsMsgBuildMessageWithTmpFile(nsIFile *aFile, nsString& aResult)
{
return nsMsgBuildMessageByName(MOZ_UTF16("unableToOpenTmpFile"), aFile, aResult);
}
nsresult
-nsMsgDisplayMessageByID(nsIPrompt * aPrompt, nsresult msgID, const PRUnichar * windowTitle)
+nsMsgDisplayMessageByID(nsIPrompt * aPrompt, nsresult msgID, const char16_t * windowTitle)
{
nsString msg;
nsMsgGetMessageByID(msgID, msg);
return nsMsgDisplayMessageByString(aPrompt, msg.get(), windowTitle);
}
nsresult
-nsMsgDisplayMessageByName(nsIPrompt *aPrompt, const nsString &aName, const PRUnichar *windowTitle)
+nsMsgDisplayMessageByName(nsIPrompt *aPrompt, const nsString &aName, const char16_t *windowTitle)
{
nsString msg;
nsMsgGetMessageByName(aName, msg);
return nsMsgDisplayMessageByString(aPrompt, msg.get(), windowTitle);
}
nsresult
-nsMsgDisplayMessageByString(nsIPrompt * aPrompt, const PRUnichar * msg, const PRUnichar * windowTitle)
+nsMsgDisplayMessageByString(nsIPrompt * aPrompt, const char16_t * msg, const char16_t * windowTitle)
{
NS_ENSURE_ARG_POINTER(msg);
nsresult rv = NS_OK;
nsCOMPtr<nsIPrompt> prompt = aPrompt;
if (!prompt)
{
@@ -111,17 +111,17 @@ nsMsgDisplayMessageByString(nsIPrompt *
if (prompt)
rv = prompt->Alert(windowTitle, msg);
return rv;
}
nsresult
-nsMsgAskBooleanQuestionByString(nsIPrompt * aPrompt, const PRUnichar * msg, bool *answer, const PRUnichar * windowTitle)
+nsMsgAskBooleanQuestionByString(nsIPrompt * aPrompt, const char16_t * msg, bool *answer, const char16_t * windowTitle)
{
NS_ENSURE_TRUE(msg && *msg, NS_ERROR_INVALID_ARG);
nsresult rv = NS_OK;
nsCOMPtr<nsIPrompt> dialog = aPrompt;
if (!dialog)
{
--- a/mailnews/compose/src/nsMsgPrompts.h
+++ b/mailnews/compose/src/nsMsgPrompts.h
@@ -11,14 +11,14 @@
#include "nsStringGlue.h"
class nsIPrompt;
nsresult nsMsgGetMessageByID(nsresult aMsgID, nsString& aResult);
nsresult nsMsgGetMessageByName(const nsString &aName, nsString& aResult);
nsresult nsMsgBuildMessageWithFile(nsIFile * aFile, nsString& aResult);
nsresult nsMsgBuildMessageWithTmpFile(nsIFile * aFile, nsString& aResult);
-nsresult nsMsgDisplayMessageByID(nsIPrompt * aPrompt, nsresult msgID, const PRUnichar * windowTitle = nullptr);
-nsresult nsMsgDisplayMessageByName(nsIPrompt *aPrompt, const nsString &aName, const PRUnichar *windowTitle = nullptr);
-nsresult nsMsgDisplayMessageByString(nsIPrompt * aPrompt, const PRUnichar * msg, const PRUnichar * windowTitle = nullptr);
-nsresult nsMsgAskBooleanQuestionByString(nsIPrompt * aPrompt, const PRUnichar * msg, bool *answer, const PRUnichar * windowTitle = nullptr);
+nsresult nsMsgDisplayMessageByID(nsIPrompt * aPrompt, nsresult msgID, const char16_t * windowTitle = nullptr);
+nsresult nsMsgDisplayMessageByName(nsIPrompt *aPrompt, const nsString &aName, const char16_t *windowTitle = nullptr);
+nsresult nsMsgDisplayMessageByString(nsIPrompt * aPrompt, const char16_t * msg, const char16_t * windowTitle = nullptr);
+nsresult nsMsgAskBooleanQuestionByString(nsIPrompt * aPrompt, const char16_t * msg, bool *answer, const char16_t * windowTitle = nullptr);
#endif /* _nsMsgPrompts_H_ */
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -1522,19 +1522,19 @@ nsMsgComposeAndSend::GetBodyFromEditor()
// member variable after doing the necessary charset conversion.
//
//
// Query the editor, get the body of HTML!
//
uint32_t flags = nsIDocumentEncoder::OutputFormatted | nsIDocumentEncoder::OutputNoFormattingInPre;
nsAutoString bodyStr;
- PRUnichar* bodyText = nullptr;
+ char16_t* bodyText = nullptr;
nsresult rv;
- PRUnichar *origHTMLBody = nullptr;
+ char16_t *origHTMLBody = nullptr;
// Ok, get the body...the DOM should have been whacked with
// Content ID's already
if (mEditor)
mEditor->OutputToString(NS_LITERAL_STRING(TEXT_HTML), flags, bodyStr);
else
bodyStr = NS_ConvertASCIItoUTF16(m_attachment1_body);
@@ -1563,17 +1563,17 @@ nsMsgComposeAndSend::GetBodyFromEditor()
nsCOMPtr<nsIPrefBranch> pPrefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (pPrefBranch)
{
rv = pPrefBranch->GetBoolPref(PREF_MAIL_SEND_STRUCT, &enable_structs);
if (enable_structs)
whattodo = whattodo | mozITXTToHTMLConv::kStructPhrase;
}
- PRUnichar* wresult;
+ char16_t* wresult;
rv = conv->ScanHTML(bodyText, whattodo, &wresult);
if (NS_SUCCEEDED(rv))
{
// Save the original body for possible attachment as plain text
// We should have what the user typed in stored in mOriginalHTMLBody
origHTMLBody = bodyText;
bodyText = wresult;
}
@@ -1596,17 +1596,17 @@ nsMsgComposeAndSend::GetBodyFromEditor()
isAsciiOnly = false;
mCompFields->SetBodyIsAsciiOnly(isAsciiOnly);
// If the body contains characters outside the current mail charset,
// convert to UTF-8.
if (NS_ERROR_UENC_NOMAPPING == rv) {
// if nbsp then replace it by sp and try again
- PRUnichar *bodyTextPtr = bodyText;
+ char16_t *bodyTextPtr = bodyText;
while (*bodyTextPtr) {
if (0x00A0 == *bodyTextPtr)
*bodyTextPtr = 0x0020;
bodyTextPtr++;
}
nsCString fallbackCharset;
rv = nsMsgI18NSaveAsCharset(mCompFields->GetForcePlainText() ? TEXT_PLAIN : TEXT_HTML,
@@ -1651,32 +1651,32 @@ nsMsgComposeAndSend::GetBodyFromEditor()
if (origHTMLBody)
{
char *newBody = nullptr;
rv = nsMsgI18NSaveAsCharset(mCompFields->GetUseMultipartAlternative() ? TEXT_PLAIN : TEXT_HTML,
aCharset, origHTMLBody, &newBody);
if (NS_SUCCEEDED(rv))
{
PR_FREEIF(origHTMLBody);
- origHTMLBody = (PRUnichar *)newBody;
+ origHTMLBody = (char16_t *)newBody;
}
}
NS_Free(bodyText); //Don't need it anymore
}
else
return NS_ERROR_FAILURE;
// If our holder for the original body text is STILL null, then just
// just copy what we have as the original body text.
if (!origHTMLBody)
mOriginalHTMLBody = ToNewCString(attachment1_body);
else
- mOriginalHTMLBody = (char *)origHTMLBody; // Whoa, origHTMLBody is declared as a PRUnichar *, what's going on here?
+ mOriginalHTMLBody = (char *)origHTMLBody; // Whoa, origHTMLBody is declared as a char16_t *, what's going on here?
rv = SnarfAndCopyBody(attachment1_body, TEXT_HTML);
return rv;
}
// for SMTP, 16k
// for our internal protocol buffers, 4k
@@ -2573,17 +2573,17 @@ nsMsgComposeAndSend::HackAttachments(nsI
}
//
// This only returns a failure code if NET_GetURL was not called
// (and thus no exit routine was or will be called.)
//
// Display some feedback to user...
- PRUnichar *printfString = nullptr;
+ char16_t *printfString = nullptr;
nsString msg;
mComposeBundle->GetStringFromID(NS_MSG_GATHERING_ATTACHMENT, getter_Copies(msg));
printfString = nsTextFormatter::smprintf(msg.get(), m_attachments[i]->m_realName.get());
if (printfString)
{
SetStatusMessage(nsDependentString(printfString));
@@ -2599,17 +2599,17 @@ nsMsgComposeAndSend::HackAttachments(nsI
if (NS_FAILED(status))
{
nsString errorMsg;
nsAutoString attachmentFileName;
nsresult rv = ConvertToUnicode(nsMsgI18NFileSystemCharset(), m_attachments[i]->m_realName, attachmentFileName);
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIStringBundle> bundle;
- const PRUnichar *params[] = { attachmentFileName.get() };
+ const char16_t *params[] = { attachmentFileName.get() };
mComposeBundle->FormatStringFromID(NS_ERROR_GET_CODE(NS_MSG_ERROR_ATTACHING_FILE), params, 1, getter_Copies(errorMsg));
mSendReport->SetMessage(nsIMsgSendReport::process_Current, errorMsg.get(), false);
mSendReport->SetError(nsIMsgSendReport::process_Current,
// XXX The following applies NS_ERROR_GENERATE_FAILURE twice,
// which doesn't make sense. Just NS_MSG_ERROR_ATTACHING_FILE is
// surely what was intended.
NS_ERROR_GENERATE_FAILURE(
NS_ERROR_MODULE_MAILNEWS,
@@ -3395,17 +3395,17 @@ nsMsgComposeAndSend::DeliverMessage()
if ((mMessageWarningSize > 0) && (fileSize > mMessageWarningSize) && (mGUINotificationEnabled))
{
bool abortTheSend = false;
nsString msg;
mComposeBundle->GetStringFromID(NS_MSG_LARGE_MESSAGE_WARNING, getter_Copies(msg));
if (!msg.IsEmpty())
{
- PRUnichar *printfString = nsTextFormatter::smprintf(msg.get(), fileSize);
+ char16_t *printfString = nsTextFormatter::smprintf(msg.get(), fileSize);
if (printfString)
{
nsCOMPtr<nsIPrompt> prompt;
GetDefaultPrompt(getter_AddRefs(prompt));
nsMsgAskBooleanQuestionByString(prompt, printfString, &abortTheSend);
if (!abortTheSend)
@@ -3630,17 +3630,17 @@ nsMsgComposeAndSend::DeliverFileAsNews()
deliveryListener, msgWindow, nullptr);
if (NS_FAILED(rv)) return rv;
}
return rv;
}
NS_IMETHODIMP
-nsMsgComposeAndSend::Fail(nsresult aFailureCode, const PRUnichar *aErrorMsg,
+nsMsgComposeAndSend::Fail(nsresult aFailureCode, const char16_t *aErrorMsg,
nsresult *aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = aFailureCode;
if (NS_FAILED(aFailureCode))
{
nsCOMPtr<nsIPrompt> prompt;
@@ -3670,34 +3670,34 @@ nsMsgComposeAndSend::Fail(nsresult aFail
//Stop any pending process...
Abort();
return NS_OK;
}
nsresult
-nsMsgComposeAndSend::FormatStringWithSMTPHostNameByID(nsresult aMsgId, PRUnichar **aString)
+nsMsgComposeAndSend::FormatStringWithSMTPHostNameByID(nsresult aMsgId, char16_t **aString)
{
NS_ENSURE_ARG(aString);
nsresult rv;
nsCOMPtr<nsISmtpService> smtpService(do_GetService(NS_SMTPSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv,rv);
// Get the smtp hostname and format the string.
nsCString smtpHostName;
nsCOMPtr<nsISmtpServer> smtpServer;
rv = smtpService->GetServerByIdentity(mUserIdentity, getter_AddRefs(smtpServer));
if (NS_SUCCEEDED(rv))
smtpServer->GetHostname(smtpHostName);
nsAutoString hostStr;
CopyASCIItoUTF16(smtpHostName, hostStr);
- const PRUnichar *params[] = { hostStr.get() };
+ const char16_t *params[] = { hostStr.get() };
if (NS_SUCCEEDED(rv))
mComposeBundle->FormatStringFromID(NS_ERROR_GET_CODE(aMsgId), params, 1, aString);
return rv;
}
void
nsMsgComposeAndSend::DoDeliveryExitProcessing(nsIURI * aUri, nsresult aExitCode, bool aCheckForMail)
{
@@ -3866,26 +3866,26 @@ nsMsgComposeAndSend::NotifyListenerOnPro
{
if (mListener)
mListener->OnProgress(aMsgID, aProgress, aProgressMax);
return NS_OK;
}
NS_IMETHODIMP
-nsMsgComposeAndSend::NotifyListenerOnStatus(const char *aMsgID, const PRUnichar *aMsg)
+nsMsgComposeAndSend::NotifyListenerOnStatus(const char *aMsgID, const char16_t *aMsg)
{
if (mListener)
mListener->OnStatus(aMsgID, aMsg);
return NS_OK;
}
NS_IMETHODIMP
-nsMsgComposeAndSend::NotifyListenerOnStopSending(const char *aMsgID, nsresult aStatus, const PRUnichar *aMsg,
+nsMsgComposeAndSend::NotifyListenerOnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg,
nsIFile *returnFile)
{
if (mListener != nullptr)
mListener->OnStopSending(aMsgID, aStatus, aMsg, returnFile);
return NS_OK;
}
@@ -3982,17 +3982,17 @@ nsMsgComposeAndSend::NotifyListenerOnSto
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
nsString msg;
- const PRUnichar *formatStrings[] = { mSavedToFolderName.get() };
+ const char16_t *formatStrings[] = { mSavedToFolderName.get() };
rv = bundle->FormatStringFromName(MOZ_UTF16("errorSavingMsg"),
formatStrings, 1,
getter_Copies(msg));
if (NS_SUCCEEDED(rv))
{
bool retry = false;
nsMsgAskBooleanQuestionByString(prompt, msg.get(), &retry, nullptr);
@@ -4317,17 +4317,17 @@ nsMsgComposeAndSend::MimeDoFCC(nsIFile
{
nsresult status = NS_OK;
char *ibuffer = 0;
int32_t ibuffer_size = TEN_K;
char *obuffer = 0;
uint32_t n;
bool folderIsLocal = true;
nsCString turi;
- PRUnichar *printfString = nullptr;
+ char16_t *printfString = nullptr;
nsString msg;
nsCOMPtr<nsIMsgFolder> folder;
// Before continuing, just check the user has not cancel the operation
if (mSendProgress)
{
bool canceled = false;
mSendProgress->GetProcessCanceledByUser(&canceled);
--- a/mailnews/compose/src/nsMsgSend.h
+++ b/mailnews/compose/src/nsMsgSend.h
@@ -175,17 +175,17 @@ public:
virtual ~nsMsgComposeAndSend();
// Delivery and completion callback routines...
NS_IMETHOD DeliverMessage();
NS_IMETHOD DeliverFileAsMail();
NS_IMETHOD DeliverFileAsNews();
void DoDeliveryExitProcessing(nsIURI * aUrl, nsresult aExitCode, bool aCheckForMail);
- nsresult FormatStringWithSMTPHostNameByID(nsresult aMsgId, PRUnichar **aString);
+ nsresult FormatStringWithSMTPHostNameByID(nsresult aMsgId, char16_t **aString);
nsresult DoFcc();
nsresult StartMessageCopyOperation(nsIFile *aFileSpec,
nsMsgDeliverMode mode,
const nsCString& dest_uri);
nsresult SendToMagicFolder(nsMsgDeliverMode flag);
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -125,17 +125,17 @@ nsMsgSendLater::Init()
// XXX may want to send messages X seconds after startup if there are any.
return NS_OK;
}
NS_IMETHODIMP
nsMsgSendLater::Observe(nsISupports *aSubject, const char* aTopic,
- const PRUnichar *aData)
+ const char16_t *aData)
{
if (aSubject == mTimer && !strcmp(aTopic, "timer-callback"))
{
if (mTimer)
mTimer->Cancel();
else
NS_ERROR("mTimer was null in nsMsgSendLater::Observe");
@@ -430,33 +430,33 @@ SendOperationListener::OnProgress(const
{
#ifdef NS_DEBUG
printf("SendOperationListener::OnProgress()\n");
#endif
return NS_OK;
}
NS_IMETHODIMP
-SendOperationListener::OnStatus(const char *aMsgID, const PRUnichar *aMsg)
+SendOperationListener::OnStatus(const char *aMsgID, const char16_t *aMsg)
{
#ifdef NS_DEBUG
printf("SendOperationListener::OnStatus()\n");
#endif
return NS_OK;
}
NS_IMETHODIMP
SendOperationListener::OnSendNotPerformed(const char *aMsgID, nsresult aStatus)
{
return NS_OK;
}
NS_IMETHODIMP
-SendOperationListener::OnStopSending(const char *aMsgID, nsresult aStatus, const PRUnichar *aMsg,
+SendOperationListener::OnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg,
nsIFile *returnFile)
{
if (mSendLater && !mSendLater->OnSendStepFinished(aStatus))
NS_RELEASE(mSendLater);
return NS_OK;
}
@@ -1323,28 +1323,28 @@ nsMsgSendLater::NotifyListenersOnProgres
{
NOTIFY_LISTENERS(OnMessageSendProgress, (aCurrentMessage, aTotalMessage,
aSendPercent, aCopyPercent));
}
void
nsMsgSendLater::NotifyListenersOnMessageSendError(uint32_t aCurrentMessage,
nsresult aStatus,
- const PRUnichar *aMsg)
+ const char16_t *aMsg)
{
NOTIFY_LISTENERS(OnMessageSendError, (aCurrentMessage, mMessage,
aStatus, aMsg));
}
/**
* This function is called to end sending of messages, it resets the send later
* system and notifies the relevant parties that we have finished.
*/
void
-nsMsgSendLater::EndSendMessages(nsresult aStatus, const PRUnichar *aMsg,
+nsMsgSendLater::EndSendMessages(nsresult aStatus, const char16_t *aMsg,
uint32_t aTotalTried, uint32_t aSuccessful)
{
// Catch-all, we may have had an issue sending, so we may not be calling
// StartNextMailFileSend to fully finish the sending. Therefore set
// mSendingMessages to false here so that we don't think we're still trying
// to send messages
mSendingMessages = false;
@@ -1521,18 +1521,18 @@ nsMsgSendLater::OnItemBoolPropertyChange
bool aOldValue, bool aNewValue)
{
return NS_OK;
}
NS_IMETHODIMP
nsMsgSendLater::OnItemUnicharPropertyChanged(nsIMsgFolder *aItem,
nsIAtom *aProperty,
- const PRUnichar* aOldValue,
- const PRUnichar* aNewValue)
+ const char16_t* aOldValue,
+ const char16_t* aNewValue)
{
return NS_OK;
}
NS_IMETHODIMP
nsMsgSendLater::OnItemPropertyFlagChanged(nsIMsgDBHdr *aItem, nsIAtom *aProperty,
uint32_t aOldValue, uint32_t aNewValue)
{
--- a/mailnews/compose/src/nsMsgSendLater.h
+++ b/mailnews/compose/src/nsMsgSendLater.h
@@ -77,18 +77,18 @@ public:
uint32_t aTotalMessage,
nsIMsgIdentity *aIdentity);
void NotifyListenersOnProgress(uint32_t aCurrentMessage,
uint32_t aTotalMessage,
uint32_t aSendPercent,
uint32_t aCopyPercent);
void NotifyListenersOnMessageSendError(uint32_t aCurrentMessage,
nsresult aStatus,
- const PRUnichar *aMsg);
- void EndSendMessages(nsresult aStatus, const PRUnichar *aMsg,
+ const char16_t *aMsg);
+ void EndSendMessages(nsresult aStatus, const char16_t *aMsg,
uint32_t aTotalTried, uint32_t aSuccessful);
bool OnSendStepFinished(nsresult aStatus);
void OnCopyStepFinished(nsresult aStatus);
// counters and things for enumeration
uint32_t mTotalSentSuccessfully;
uint32_t mTotalSendCount;
--- a/mailnews/compose/src/nsMsgSendReport.cpp
+++ b/mailnews/compose/src/nsMsgSendReport.cpp
@@ -48,23 +48,23 @@ NS_IMETHODIMP nsMsgProcessReport::GetErr
}
NS_IMETHODIMP nsMsgProcessReport::SetError(nsresult aError)
{
mError = aError;
return NS_OK;
}
/* attribute wstring message; */
-NS_IMETHODIMP nsMsgProcessReport::GetMessage(PRUnichar * *aMessage)
+NS_IMETHODIMP nsMsgProcessReport::GetMessage(char16_t * *aMessage)
{
NS_ENSURE_ARG_POINTER(aMessage);
*aMessage = ToNewUnicode(mMessage);
return NS_OK;
}
-NS_IMETHODIMP nsMsgProcessReport::SetMessage(const PRUnichar * aMessage)
+NS_IMETHODIMP nsMsgProcessReport::SetMessage(const char16_t * aMessage)
{
mMessage = aMessage;
return NS_OK;
}
/* void Reset (); */
NS_IMETHODIMP nsMsgProcessReport::Reset()
{
@@ -178,17 +178,17 @@ NS_IMETHODIMP nsMsgSendReport::SetError(
mProcessReport[process]->GetError(&currError);
if (overwriteError || NS_SUCCEEDED(currError))
return mProcessReport[process]->SetError(newError);
else
return NS_OK;
}
/* void setMessage (in long process, in wstring message, in boolean overwriteMessage); */
-NS_IMETHODIMP nsMsgSendReport::SetMessage(int32_t process, const PRUnichar *message, bool overwriteMessage)
+NS_IMETHODIMP nsMsgSendReport::SetMessage(int32_t process, const char16_t *message, bool overwriteMessage)
{
if (process < process_Current || process > SEND_LAST_PROCESS)
return NS_ERROR_ILLEGAL_VALUE;
if (process == process_Current)
{
if (mCurrentProcess == process_Current)
// We don't know what we're currently trying to do
@@ -343,17 +343,17 @@ NS_IMETHODIMP nsMsgSendReport::DisplayRe
}
if (!currMessage.IsEmpty())
{
//Don't need to repeat ourself!
if (!currMessage.Equals(dialogMessage))
{
if (!dialogMessage.IsEmpty())
- dialogMessage.Append(PRUnichar('\n'));
+ dialogMessage.Append(char16_t('\n'));
dialogMessage.Append(currMessage);
}
}
if (askToGoBackToCompose)
{
bool oopsGiveMeBackTheComposeWindow = true;
nsString text1;
@@ -407,17 +407,17 @@ NS_IMETHODIMP nsMsgSendReport::DisplayRe
{
//we don't have an error description but we can put a generic explanation
bundle->GetStringFromID(NS_MSG_GENERIC_FAILURE_EXPLANATION, getter_Copies(currMessage));
}
if (!currMessage.IsEmpty())
{
if (!dialogMessage.IsEmpty())
- dialogMessage.Append(PRUnichar('\n'));
+ dialogMessage.Append(char16_t('\n'));
dialogMessage.Append(currMessage);
}
nsMsgDisplayMessageByString(prompt, dialogMessage.get(), dialogTitle.get());
}
mAlreadyDisplayReport = true;
return NS_OK;
}
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -78,17 +78,17 @@ nsresult nsExplainErrorDetails(nsISmtpUr
NS_ENSURE_ARG(aSmtpUrl);
va_list args;
nsCOMPtr<nsIPrompt> dialog;
aSmtpUrl->GetPrompt(getter_AddRefs(dialog));
NS_ENSURE_TRUE(dialog, NS_ERROR_FAILURE);
- PRUnichar * msg;
+ char16_t * msg;
nsString eMsg;
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
nsresult rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
@@ -442,17 +442,17 @@ void nsSmtpProtocol::UpdateStatus(int32_
nsresult rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
if (NS_FAILED(rv)) return;
nsString msg;
bundle->GetStringFromID(aStatusID, getter_Copies(msg));
UpdateStatusWithString(msg.get());
}
}
-void nsSmtpProtocol::UpdateStatusWithString(const PRUnichar * aStatusString)
+void nsSmtpProtocol::UpdateStatusWithString(const char16_t * aStatusString)
{
if (m_statusFeedback && aStatusString)
m_statusFeedback->ShowStatusString(nsDependentString(aStatusString));
}
/////////////////////////////////////////////////////////////////////////////////////////////
// Begin protocol state machine functions...
//////////////////////////////////////////////////////////////////////////////////////////////
@@ -2014,33 +2014,33 @@ nsSmtpProtocol::GetPassword(nsCString &a
nsCString hostname;
rv = smtpServer->GetHostname(hostname);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString hostnameUTF16;
CopyASCIItoUTF16(hostname, hostnameUTF16);
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
hostnameUTF16.get(),
usernameUTF16.get()
};
rv = PromptForPassword(smtpServer, smtpUrl, formatStrings, aPassword);
NS_ENSURE_SUCCESS(rv,rv);
return rv;
}
/**
* formatStrings is an array for the prompts, item 0 is the hostname, item 1
* is the username.
*/
nsresult
-nsSmtpProtocol::PromptForPassword(nsISmtpServer *aSmtpServer, nsISmtpUrl *aSmtpUrl, const PRUnichar **formatStrings, nsACString &aPassword)
+nsSmtpProtocol::PromptForPassword(nsISmtpServer *aSmtpServer, nsISmtpUrl *aSmtpUrl, const char16_t **formatStrings, nsACString &aPassword)
{
nsCOMPtr<nsIStringBundleService> stringService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(stringService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> composeStringBundle;
nsresult rv = stringService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(composeStringBundle));
NS_ENSURE_SUCCESS(rv,rv);
@@ -2098,17 +2098,17 @@ nsSmtpProtocol::GetUsernamePassword(nsAC
// empty password
aPassword.Truncate();
nsCString hostname;
rv = smtpServer->GetHostname(hostname);
NS_ENSURE_SUCCESS(rv, rv);
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
NS_ConvertASCIItoUTF16(hostname).get(),
nullptr
};
rv = PromptForPassword(smtpServer, smtpUrl, formatStrings, aPassword);
NS_ENSURE_SUCCESS(rv,rv);
return rv;
--- a/mailnews/compose/src/nsSmtpProtocol.h
+++ b/mailnews/compose/src/nsSmtpProtocol.h
@@ -145,17 +145,17 @@ private:
virtual nsresult ProcessProtocolState(nsIURI * url, nsIInputStream * inputStream,
uint64_t sourceOffset, uint32_t length) MOZ_OVERRIDE;
////////////////////////////////////////////////////////////////////////////////////////
// Communication methods --> Reading and writing protocol
////////////////////////////////////////////////////////////////////////////////////////
void UpdateStatus(int32_t aStatusID);
- void UpdateStatusWithString(const PRUnichar * aStatusString);
+ void UpdateStatusWithString(const char16_t * aStatusString);
////////////////////////////////////////////////////////////////////////////////////////
// Protocol Methods --> This protocol is state driven so each protocol method is
// designed to re-act to the current "state". I've attempted to
// group them together based on functionality.
////////////////////////////////////////////////////////////////////////////////////////
nsresult SmtpResponse(nsIInputStream * inputStream, uint32_t length);
@@ -186,17 +186,17 @@ private:
////////////////////////////////////////////////////////////////////////////////////////
void SendMessageInFile();
void AppendHelloArgument(nsACString& aResult);
nsresult GetPassword(nsCString &aPassword);
nsresult GetUsernamePassword(nsACString &aUsername, nsACString &aPassword);
nsresult PromptForPassword(nsISmtpServer *aSmtpServer, nsISmtpUrl *aSmtpUrl,
- const PRUnichar **formatStrings,
+ const char16_t **formatStrings,
nsACString &aPassword);
void InitPrefAuthMethods(int32_t authMethodPrefValue);
nsresult ChooseAuthMethod();
void MarkAuthMethodAsFailed(int32_t failedAuthMethod);
void ResetAuthMethods();
virtual const char* GetType() MOZ_OVERRIDE {return "smtp";}
--- a/mailnews/compose/src/nsSmtpServer.cpp
+++ b/mailnews/compose/src/nsSmtpServer.cpp
@@ -411,18 +411,18 @@ nsSmtpServer::GetPasswordWithoutUI()
}
}
}
NS_FREE_XPCOM_ISUPPORTS_POINTER_ARRAY(numLogins, logins);
return NS_OK;
}
NS_IMETHODIMP
-nsSmtpServer::GetPasswordWithUI(const PRUnichar *aPromptMessage,
- const PRUnichar *aPromptTitle,
+nsSmtpServer::GetPasswordWithUI(const char16_t *aPromptMessage,
+ const char16_t *aPromptTitle,
nsIAuthPrompt* aDialog,
nsACString &aPassword)
{
if (!m_password.IsEmpty())
return GetPassword(aPassword);
// We need to get a password, but see if we can get it from the password
// manager without requiring a prompt.
@@ -464,18 +464,18 @@ nsSmtpServer::GetPasswordWithUI(const PR
rv = SetPassword(password);
NS_ENSURE_SUCCESS(rv, rv);
aPassword = password;
return NS_OK;
}
NS_IMETHODIMP
-nsSmtpServer::GetUsernamePasswordWithUI(const PRUnichar * aPromptMessage, const
- PRUnichar *aPromptTitle,
+nsSmtpServer::GetUsernamePasswordWithUI(const char16_t * aPromptMessage, const
+ char16_t *aPromptTitle,
nsIAuthPrompt* aDialog,
nsACString &aUsername,
nsACString &aPassword)
{
nsresult rv;
if (!m_password.IsEmpty())
{
rv = GetUsername(aUsername);
--- a/mailnews/compose/src/nsURLFetcher.cpp
+++ b/mailnews/compose/src/nsURLFetcher.cpp
@@ -378,17 +378,17 @@ nsURLFetcher::OnLocationChange(nsIWebPro
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsURLFetcher::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
- const PRUnichar* aMessage)
+ const char16_t* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsURLFetcher::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
--- a/mailnews/db/msgdb/src/nsDBFolderInfo.cpp
+++ b/mailnews/db/msgdb/src/nsDBFolderInfo.cpp
@@ -58,17 +58,17 @@ public:
NS_DECL_NSIOBSERVER
nsFolderCharsetObserver() { }
virtual ~nsFolderCharsetObserver() {}
};
NS_IMPL_ISUPPORTS1(nsFolderCharsetObserver, nsIObserver)
-NS_IMETHODIMP nsFolderCharsetObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
+NS_IMETHODIMP nsFolderCharsetObserver::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData)
{
nsresult rv;
nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIPrefBranch> prefBranch;
rv = prefs->GetBranch(nullptr, getter_AddRefs(prefBranch));
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -689,17 +689,17 @@ enum char_class{
kanji,
kuten,
touten,
kigou,
fwlatain,
ascii
};
-static char_class getCharClass(PRUnichar c)
+static char_class getCharClass(char16_t c)
{
char_class charClass = others;
if(IS_JA_HIRAGANA(c))
charClass = hiragana;
else if(IS_JA_KATAKANA(c))
charClass = katakana;
else if(IS_JA_KANJI(c))
@@ -712,44 +712,44 @@ static char_class getCharClass(PRUnichar
charClass = fwlatain;
return charClass;
}
static bool isJapanese(const char* word)
{
nsString text = NS_ConvertUTF8toUTF16(word);
- PRUnichar* p = (PRUnichar*)text.get();
- PRUnichar c;
+ char16_t* p = (char16_t*)text.get();
+ char16_t c;
// it is japanese chunk if it contains any hiragana or katakana.
while((c = *p++))
if( IS_JAPANESE_SPECIFIC(c))
return true;
return false;
}
-static bool isFWNumeral(const PRUnichar* p1, const PRUnichar* p2)
+static bool isFWNumeral(const char16_t* p1, const char16_t* p2)
{
for(;p1<p2;p1++)
if(!IS_JA_FWNUMERAL(*p1))
return false;
return true;
}
// The japanese tokenizer was added as part of Bug #277354
void Tokenizer::tokenize_japanese_word(char* chunk)
{
PR_LOG(BayesianFilterLogModule, PR_LOG_DEBUG, ("entering tokenize_japanese_word(%s)", chunk));
nsString srcStr = NS_ConvertUTF8toUTF16(chunk);
- const PRUnichar* p1 = srcStr.get();
- const PRUnichar* p2 = p1;
+ const char16_t* p1 = srcStr.get();
+ const char16_t* p2 = p1;
if(!*p2) return;
char_class cc = getCharClass(*p2);
while(*(++p2))
{
if(cc == getCharClass(*p2))
continue;
@@ -801,18 +801,18 @@ void Tokenizer::tokenize(const char* aTe
NS_LITERAL_STRING("<div"));
MsgReplaceSubstring(text, NS_LITERAL_STRING("/iframe>"),
NS_LITERAL_STRING("/div>"));
}
stripHTML(text, strippedUCS2);
// convert 0x3000(full width space) into 0x0020
- PRUnichar * substr_start = strippedUCS2.BeginWriting();
- PRUnichar * substr_end = strippedUCS2.EndWriting();
+ char16_t * substr_start = strippedUCS2.BeginWriting();
+ char16_t * substr_end = strippedUCS2.EndWriting();
while (substr_start != substr_end) {
if (*substr_start == 0x3000)
*substr_start = 0x0020;
++substr_start;
}
nsCString strippedStr = NS_ConvertUTF16toUTF8(strippedUCS2);
char * strippedText = strippedStr.BeginWriting();
@@ -837,17 +837,17 @@ void Tokenizer::tokenize(const char* aTe
return;
}
}
if (mScanner) {
mScanner->Start("UTF-8");
// convert this word from UTF-8 into UCS2.
NS_ConvertUTF8toUTF16 uword(word);
ToLowerCase(uword);
- const PRUnichar* utext = uword.get();
+ const char16_t* utext = uword.get();
int32_t len = uword.Length(), pos = 0, begin, end;
bool gotUnit;
while (pos < len) {
rv = mScanner->Next(utext, len, pos, true, &begin, &end, &gotUnit);
if (NS_SUCCEEDED(rv) && gotUnit) {
NS_ConvertUTF16toUTF8 utfUnit(utext + begin, end - begin);
add(utfUnit.get());
// advance to end of current unit.
@@ -988,17 +988,17 @@ TokenStreamListener::~TokenStreamListene
NS_IMPL_ISUPPORTS3(TokenStreamListener, nsIRequestObserver, nsIStreamListener, nsIMsgHeaderSink)
NS_IMETHODIMP TokenStreamListener::ProcessHeaders(nsIUTF8StringEnumerator *aHeaderNames, nsIUTF8StringEnumerator *aHeaderValues, bool dontCollectAddress)
{
mTokenizer.tokenizeHeaders(aHeaderNames, aHeaderValues);
return NS_OK;
}
-NS_IMETHODIMP TokenStreamListener::HandleAttachment(const char *contentType, const char *url, const PRUnichar *displayName, const char *uri, bool aIsExternalAttachment)
+NS_IMETHODIMP TokenStreamListener::HandleAttachment(const char *contentType, const char *url, const char16_t *displayName, const char *uri, bool aIsExternalAttachment)
{
mTokenizer.tokenizeAttachment(contentType, NS_ConvertUTF16toUTF8(displayName).get());
return NS_OK;
}
NS_IMETHODIMP TokenStreamListener::AddAttachmentField(const char *field, const char *value)
{
return NS_OK;
@@ -1686,17 +1686,17 @@ void nsBayesianFilter::classifyMessage(
else
prob = 0.5;
if (aDetailListener)
{
// Prepare output arrays
nsTArray<uint32_t> tokenPercents(usedTokenCount);
nsTArray<uint32_t> runningPercents(usedTokenCount);
- nsTArray<PRUnichar*> tokenStrings(usedTokenCount);
+ nsTArray<char16_t*> tokenStrings(usedTokenCount);
double clueCount = 1.0;
for (uint32_t tokenIndex = 0; tokenIndex < usedTokenCount; tokenIndex++)
{
TraitAnalysis& ta = traitAnalyses[last - 1 - tokenIndex];
double S, H;
int32_t chi_error;
S = chi2P(-2.0 * sArray[tokenIndex], 2.0 * clueCount, &chi_error);
@@ -1712,17 +1712,17 @@ void nsBayesianFilter::classifyMessage(
100. + .5));
tokenPercents.AppendElement(static_cast<uint32_t>(ta.mProbability *
100. + .5));
tokenStrings.AppendElement(ToNewUnicode(NS_ConvertUTF8toUTF16(
tokens[ta.mTokenIndex].mWord)));
}
aDetailListener->OnMessageTraitDetails(messageURI, aProTraits[traitIndex],
- usedTokenCount, (const PRUnichar**)tokenStrings.Elements(),
+ usedTokenCount, (const char16_t**)tokenStrings.Elements(),
tokenPercents.Elements(), runningPercents.Elements());
for (uint32_t tokenIndex = 0; tokenIndex < usedTokenCount; tokenIndex++)
NS_Free(tokenStrings[tokenIndex]);
}
uint32_t proPercent = static_cast<uint32_t>(prob*100. + .5);
// directly classify junk to maintain backwards compatibility
@@ -1792,17 +1792,17 @@ void nsBayesianFilter::classifyMessage(
proTraits.AppendElement(kJunkTrait);
antiTraits.AppendElement(kGoodTrait);
classifyMessage(tokens, messageURI, proTraits, antiTraits,
aJunkListener, nullptr, nullptr);
}
NS_IMETHODIMP
nsBayesianFilter::Observe(nsISupports *aSubject, const char *aTopic,
- const PRUnichar *someData)
+ const char16_t *someData)
{
if (!strcmp(aTopic, "profile-before-change"))
Shutdown();
return NS_OK;
}
/* void shutdown (); */
NS_IMETHODIMP nsBayesianFilter::Shutdown()
--- a/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
+++ b/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
@@ -33,31 +33,31 @@ NS_IMPL_RELEASE(nsMsgMailView)
NS_IMPL_QUERY_INTERFACE1(nsMsgMailView, nsIMsgMailView)
nsMsgMailView::~nsMsgMailView()
{
if (mViewSearchTerms)
mViewSearchTerms->Clear();
}
-NS_IMETHODIMP nsMsgMailView::GetMailViewName(PRUnichar ** aMailViewName)
+NS_IMETHODIMP nsMsgMailView::GetMailViewName(char16_t ** aMailViewName)
{
NS_ENSURE_ARG_POINTER(aMailViewName);
*aMailViewName = ToNewUnicode(mName);
return NS_OK;
}
-NS_IMETHODIMP nsMsgMailView::SetMailViewName(const PRUnichar * aMailViewName)
+NS_IMETHODIMP nsMsgMailView::SetMailViewName(const char16_t * aMailViewName)
{
mName = aMailViewName;
return NS_OK;
}
-NS_IMETHODIMP nsMsgMailView::GetPrettyName(PRUnichar ** aMailViewName)
+NS_IMETHODIMP nsMsgMailView::GetPrettyName(char16_t ** aMailViewName)
{
NS_ENSURE_ARG_POINTER(aMailViewName);
nsresult rv = NS_OK;
if (!mBundle)
{
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
--- a/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
+++ b/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
@@ -93,40 +93,40 @@ nsMsgMdnGenerator::nsMsgMdnGenerator()
m_outsideDomainOp = eNeverSendOp;
m_otherOp = eNeverSendOp;
}
nsMsgMdnGenerator::~nsMsgMdnGenerator()
{
}
-nsresult nsMsgMdnGenerator::FormatStringFromName(const PRUnichar *aName,
- const PRUnichar *aString,
- PRUnichar **aResultString)
+nsresult nsMsgMdnGenerator::FormatStringFromName(const char16_t *aName,
+ const char16_t *aString,
+ char16_t **aResultString)
{
DEBUG_MDN("nsMsgMdnGenerator::FormatStringFromName");
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr <nsIStringBundle> bundle;
nsresult rv = bundleService->CreateBundle(MDN_STRINGBUNDLE_URL,
getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv,rv);
- const PRUnichar *formatStrings[1] = { aString };
+ const char16_t *formatStrings[1] = { aString };
rv = bundle->FormatStringFromName(aName,
formatStrings, 1, aResultString);
NS_ENSURE_SUCCESS(rv,rv);
return rv;
}
-nsresult nsMsgMdnGenerator::GetStringFromName(const PRUnichar *aName,
- PRUnichar **aResultString)
+nsresult nsMsgMdnGenerator::GetStringFromName(const char16_t *aName,
+ char16_t **aResultString)
{
DEBUG_MDN("nsMsgMdnGenerator::GetStringFromName");
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr <nsIStringBundle> bundle;
@@ -1109,17 +1109,17 @@ NS_IMETHODIMP nsMsgMdnGenerator::OnStopR
nsCString smtpHostName;
nsCOMPtr<nsISmtpServer> smtpServer;
rv = smtpService->GetServerByIdentity(m_identity, getter_AddRefs(smtpServer));
if (NS_SUCCEEDED(rv))
smtpServer->GetHostname(smtpHostName);
nsAutoString hostStr;
CopyASCIItoUTF16(smtpHostName, hostStr);
- const PRUnichar *params[] = { hostStr.get() };
+ const char16_t *params[] = { hostStr.get() };
nsCOMPtr<nsIStringBundle> bundle;
nsCOMPtr<nsIStringBundleService> bundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
rv = bundleService->CreateBundle("chrome://messenger/locale/messengercompose/composeMsgs.properties", getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/extensions/mdn/src/nsMsgMdnGenerator.h
+++ b/mailnews/extensions/mdn/src/nsMsgMdnGenerator.h
@@ -46,20 +46,20 @@ private:
nsresult CreateMdnMsg();
nsresult CreateFirstPart();
nsresult CreateSecondPart();
nsresult CreateThirdPart();
nsresult SendMdnMsg();
// string bundle helper methods
- nsresult GetStringFromName(const PRUnichar *aName, PRUnichar **aResultString);
- nsresult FormatStringFromName(const PRUnichar *aName,
- const PRUnichar *aString,
- PRUnichar **aResultString);
+ nsresult GetStringFromName(const char16_t *aName, char16_t **aResultString);
+ nsresult FormatStringFromName(const char16_t *aName,
+ const char16_t *aString,
+ char16_t **aResultString);
// other helper methods
nsresult InitAndProcess(bool *needToAskUser);
nsresult OutputAllHeaders();
nsresult WriteString(const char *str);
private:
EDisposeType m_disposeType;
--- a/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
+++ b/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
@@ -165,34 +165,34 @@ NS_IMETHODIMP nsMsgComposeSecure::Requir
if (alwaysEncryptMessages || signMessage)
*aRequiresEncryptionWork = true;
return NS_OK;
}
-nsresult nsMsgComposeSecure::GetSMIMEBundleString(const PRUnichar *name,
- PRUnichar **outString)
+nsresult nsMsgComposeSecure::GetSMIMEBundleString(const char16_t *name,
+ char16_t **outString)
{
*outString = nullptr;
NS_ENSURE_ARG_POINTER(name);
NS_ENSURE_TRUE(InitializeSMIMEBundle(), NS_ERROR_FAILURE);
return mSMIMEBundle->GetStringFromName(name, outString);
}
nsresult
nsMsgComposeSecure::
-SMIMEBundleFormatStringFromName(const PRUnichar *name,
- const PRUnichar **params,
+SMIMEBundleFormatStringFromName(const char16_t *name,
+ const char16_t **params,
uint32_t numParams,
- PRUnichar **outString)
+ char16_t **outString)
{
NS_ENSURE_ARG_POINTER(name);
if (!InitializeSMIMEBundle())
return NS_ERROR_FAILURE;
return mSMIMEBundle->FormatStringFromName(name, params,
numParams, outString);
@@ -207,17 +207,17 @@ bool nsMsgComposeSecure::InitializeSMIME
mozilla::services::GetStringBundleService();
nsresult rv = bundleService->CreateBundle(SMIME_STRBUNDLE_URL,
getter_AddRefs(mSMIMEBundle));
NS_ENSURE_SUCCESS(rv, false);
return true;
}
-void nsMsgComposeSecure::SetError(nsIMsgSendReport *sendReport, const PRUnichar *bundle_string)
+void nsMsgComposeSecure::SetError(nsIMsgSendReport *sendReport, const char16_t *bundle_string)
{
if (!sendReport || !bundle_string)
return;
if (mErrorAlreadyReported)
return;
mErrorAlreadyReported = true;
@@ -231,29 +231,29 @@ void nsMsgComposeSecure::SetError(nsIMsg
if (NS_SUCCEEDED(res) && !errorString.IsEmpty())
{
sendReport->SetMessage(nsIMsgSendReport::process_Current,
errorString.get(),
true);
}
}
-void nsMsgComposeSecure::SetErrorWithParam(nsIMsgSendReport *sendReport, const PRUnichar *bundle_string, const char *param)
+void nsMsgComposeSecure::SetErrorWithParam(nsIMsgSendReport *sendReport, const char16_t *bundle_string, const char *param)
{
if (!sendReport || !bundle_string || !param)
return;
if (mErrorAlreadyReported)
return;
mErrorAlreadyReported = true;
nsString errorString;
nsresult res;
- const PRUnichar *params[1];
+ const char16_t *params[1];
NS_ConvertASCIItoUTF16 ucs2(param);
params[0]= ucs2.get();
res = SMIMEBundleFormatStringFromName(bundle_string,
params,
1,
getter_Copies(errorString));
--- a/mailnews/extensions/smime/src/nsMsgComposeSecure.h
+++ b/mailnews/extensions/smime/src/nsMsgComposeSecure.h
@@ -61,22 +61,22 @@ public:
private:
typedef mozilla::mailnews::MimeEncoder MimeEncoder;
nsresult MimeInitMultipartSigned(bool aOuter, nsIMsgSendReport *sendReport);
nsresult MimeInitEncryption(bool aSign, nsIMsgSendReport *sendReport);
nsresult MimeFinishMultipartSigned (bool aOuter, nsIMsgSendReport *sendReport);
nsresult MimeFinishEncryption (bool aSign, nsIMsgSendReport *sendReport);
nsresult MimeCryptoHackCerts(const char *aRecipients, nsIMsgSendReport *sendReport, bool aEncrypt, bool aSign);
bool InitializeSMIMEBundle();
- nsresult GetSMIMEBundleString(const PRUnichar *name,
- PRUnichar **outString);
- nsresult SMIMEBundleFormatStringFromName(const PRUnichar *name,
- const PRUnichar **params,
+ nsresult GetSMIMEBundleString(const char16_t *name,
+ char16_t **outString);
+ nsresult SMIMEBundleFormatStringFromName(const char16_t *name,
+ const char16_t **params,
uint32_t numParams,
- PRUnichar **outString);
+ char16_t **outString);
nsresult ExtractEncryptionState(nsIMsgIdentity * aIdentity, nsIMsgCompFields * aComposeFields, bool * aSignMessage, bool * aEncrypt);
mimeDeliveryCryptoState mCryptoState;
nsCOMPtr<nsIOutputStream> mStream;
int16_t mHashType;
nsCOMPtr<nsICryptoHash> mDataHash;
nsAutoPtr<MimeEncoder> mSigEncoder;
char *mMultipartSignedBoundary;
@@ -92,13 +92,13 @@ private:
nsAutoPtr<MimeEncoder> mCryptoEncoder;
bool mIsDraft;
enum {eBufferSize = 8192};
char *mBuffer;
uint32_t mBufferedBytes;
bool mErrorAlreadyReported;
- void SetError(nsIMsgSendReport *sendReport, const PRUnichar *bundle_string);
- void SetErrorWithParam(nsIMsgSendReport *sendReport, const PRUnichar *bundle_string, const char *param);
+ void SetError(nsIMsgSendReport *sendReport, const char16_t *bundle_string);
+ void SetErrorWithParam(nsIMsgSendReport *sendReport, const char16_t *bundle_string, const char *param);
};
#endif
--- a/mailnews/extensions/smime/src/nsSMimeJSHelper.cpp
+++ b/mailnews/extensions/smime/src/nsSMimeJSHelper.cpp
@@ -25,20 +25,20 @@ nsSMimeJSHelper::nsSMimeJSHelper()
nsSMimeJSHelper::~nsSMimeJSHelper()
{
}
NS_IMETHODIMP nsSMimeJSHelper::GetRecipientCertsInfo(
nsIMsgCompFields *compFields,
uint32_t *count,
- PRUnichar ***emailAddresses,
+ char16_t ***emailAddresses,
int32_t **certVerification,
- PRUnichar ***certIssuedInfos,
- PRUnichar ***certExpiresInfos,
+ char16_t ***certIssuedInfos,
+ char16_t ***certExpiresInfos,
nsIX509Cert ***certs,
bool *canEncrypt)
{
NS_ENSURE_ARG_POINTER(count);
*count = 0;
NS_ENSURE_ARG_POINTER(emailAddresses);
NS_ENSURE_ARG_POINTER(certVerification);
@@ -58,37 +58,37 @@ NS_IMETHODIMP nsSMimeJSHelper::GetRecipi
nsCOMPtr<nsIX509CertDB> certdb = do_GetService(NS_X509CERTDB_CONTRACTID);
*count = mailbox_count;
*canEncrypt = false;
rv = NS_OK;
if (mailbox_count)
{
- PRUnichar **outEA = static_cast<PRUnichar **>(nsMemory::Alloc(mailbox_count * sizeof(PRUnichar *)));
+ char16_t **outEA = static_cast<char16_t **>(nsMemory::Alloc(mailbox_count * sizeof(char16_t *)));
int32_t *outCV = static_cast<int32_t *>(nsMemory::Alloc(mailbox_count * sizeof(int32_t)));
- PRUnichar **outCII = static_cast<PRUnichar **>(nsMemory::Alloc(mailbox_count * sizeof(PRUnichar *)));
- PRUnichar **outCEI = static_cast<PRUnichar **>(nsMemory::Alloc(mailbox_count * sizeof(PRUnichar *)));
+ char16_t **outCII = static_cast<char16_t **>(nsMemory::Alloc(mailbox_count * sizeof(char16_t *)));
+ char16_t **outCEI = static_cast<char16_t **>(nsMemory::Alloc(mailbox_count * sizeof(char16_t *)));
nsIX509Cert **outCerts = static_cast<nsIX509Cert **>(nsMemory::Alloc(mailbox_count * sizeof(nsIX509Cert *)));
if (!outEA || !outCV || !outCII || !outCEI || !outCerts)
{
nsMemory::Free(outEA);
nsMemory::Free(outCV);
nsMemory::Free(outCII);
nsMemory::Free(outCEI);
nsMemory::Free(outCerts);
rv = NS_ERROR_OUT_OF_MEMORY;
}
else
{
- PRUnichar **iEA = outEA;
+ char16_t **iEA = outEA;
int32_t *iCV = outCV;
- PRUnichar **iCII = outCII;
- PRUnichar **iCEI = outCEI;
+ char16_t **iCII = outCII;
+ char16_t **iCEI = outCEI;
nsIX509Cert **iCert = outCerts;
bool found_blocker = false;
bool memory_failure = false;
for (uint32_t i = 0;
i < mailbox_count;
++i, ++iEA, ++iCV, ++iCII, ++iCEI, ++iCert)
@@ -174,17 +174,17 @@ NS_IMETHODIMP nsSMimeJSHelper::GetRecipi
}
}
return rv;
}
NS_IMETHODIMP nsSMimeJSHelper::GetNoCertAddresses(
nsIMsgCompFields *compFields,
uint32_t *count,
- PRUnichar ***emailAddresses)
+ char16_t ***emailAddresses)
{
NS_ENSURE_ARG_POINTER(count);
*count = 0;
NS_ENSURE_ARG_POINTER(emailAddresses);
NS_ENSURE_ARG_POINTER(compFields);
@@ -230,24 +230,24 @@ NS_IMETHODIMP nsSMimeJSHelper::GetNoCert
++missing_count;
}
}
*count = missing_count;
if (missing_count)
{
- PRUnichar **outEA = static_cast<PRUnichar **>(nsMemory::Alloc(missing_count * sizeof(PRUnichar *)));
+ char16_t **outEA = static_cast<char16_t **>(nsMemory::Alloc(missing_count * sizeof(char16_t *)));
if (!outEA )
{
rv = NS_ERROR_OUT_OF_MEMORY;
}
else
{
- PRUnichar **iEA = outEA;
+ char16_t **iEA = outEA;
bool memory_failure = false;
for (uint32_t i = 0; i < mailbox_count; ++i)
{
if (!haveCert[i])
{
if (memory_failure) {
--- a/mailnews/imap/src/nsAutoSyncManager.cpp
+++ b/mailnews/imap/src/nsAutoSyncManager.cpp
@@ -547,17 +547,17 @@ NS_IMETHODIMP nsAutoSyncManager::Pause()
NS_IMETHODIMP nsAutoSyncManager::Resume()
{
mPaused = false;
StartTimerIfNeeded();
PR_LOG(gAutoSyncLog, PR_LOG_DEBUG, ("autosync resumed\n"));
return NS_OK;
}
-NS_IMETHODIMP nsAutoSyncManager::Observe(nsISupports*, const char *aTopic, const PRUnichar *aSomeData)
+NS_IMETHODIMP nsAutoSyncManager::Observe(nsISupports*, const char *aTopic, const char16_t *aSomeData)
{
if (!PL_strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
{
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
if (observerService)
{
observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
--- a/mailnews/imap/src/nsIMAPHostSessionList.cpp
+++ b/mailnews/imap/src/nsIMAPHostSessionList.cpp
@@ -82,17 +82,17 @@ nsresult nsIMAPHostSessionList::Init()
mozilla::services::GetObserverService();
NS_ENSURE_TRUE(observerService, NS_ERROR_UNEXPECTED);
observerService->AddObserver(this, "profile-before-change", true);
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, true);
return NS_OK;
}
-NS_IMETHODIMP nsIMAPHostSessionList::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
+NS_IMETHODIMP nsIMAPHostSessionList::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData)
{
if (!strcmp(aTopic, "profile-before-change"))
ResetAll();
else if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
{
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
NS_ENSURE_TRUE(observerService, NS_ERROR_UNEXPECTED);
--- a/mailnews/imap/src/nsImapCore.h
+++ b/mailnews/imap/src/nsImapCore.h
@@ -165,17 +165,17 @@ typedef enum {
typedef struct _utf_name_struct {
bool toUtf7Imap;
unsigned char *sourceString;
unsigned char *convertedString;
} utf_name_struct;
typedef struct _ProgressInfo {
- PRUnichar *message;
+ char16_t *message;
int32_t currentProgress;
int32_t maxProgress;
} ProgressInfo;
typedef enum {
eContinue,
eContinueNew,
eListMyChildren,
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -1796,17 +1796,17 @@ nsImapIncomingServer::FEAlert(const nsAS
if (m_stringBundle)
{
nsAutoString hostName;
nsresult rv = GetPrettyName(hostName);
if (NS_SUCCEEDED(rv))
{
nsString message;
nsString tempString(aAlertString);
- const PRUnichar *params[] = { hostName.get(), tempString.get() };
+ const char16_t *params[] = { hostName.get(), tempString.get() };
rv = m_stringBundle->FormatStringFromName(
MOZ_UTF16("imapServerAlert"),
params, 2, getter_Copies(message));
if (NS_SUCCEEDED(rv))
return AlertUser(message, aUrl);
}
}
@@ -1836,17 +1836,17 @@ nsImapIncomingServer::FEAlertWithName(co
nsString message;
if (m_stringBundle)
{
nsAutoString hostName;
nsresult rv = GetPrettyName(hostName);
if (NS_SUCCEEDED(rv))
{
- const PRUnichar *params[] = { hostName.get() };
+ const char16_t *params[] = { hostName.get() };
rv = m_stringBundle->FormatStringFromName(
NS_ConvertASCIItoUTF16(aMsgName).get(),
params, 1,getter_Copies(message));
if (NS_SUCCEEDED(rv))
return AlertUser(message, aUrl);
}
}
@@ -1877,17 +1877,17 @@ NS_IMETHODIMP nsImapIncomingServer::FEA
// Adjust the message.
if (pos != -1)
message = Substring(message, pos + 1);
nsString hostName;
GetPrettyName(hostName);
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
hostName.get(),
nullptr,
nullptr
};
nsString msgName;
int32_t numStrings;
@@ -2468,25 +2468,25 @@ NS_IMETHODIMP
nsImapIncomingServer::GetSubscribeListener(nsISubscribeListener **aListener)
{
nsresult rv = EnsureInner();
NS_ENSURE_SUCCESS(rv,rv);
return mInner->GetSubscribeListener(aListener);
}
NS_IMETHODIMP
-nsImapIncomingServer::Subscribe(const PRUnichar *aName)
+nsImapIncomingServer::Subscribe(const char16_t *aName)
{
NS_ENSURE_ARG_POINTER(aName);
return SubscribeToFolder(nsDependentString(aName), true, nullptr);
}
NS_IMETHODIMP
-nsImapIncomingServer::Unsubscribe(const PRUnichar *aName)
+nsImapIncomingServer::Unsubscribe(const char16_t *aName)
{
NS_ENSURE_ARG_POINTER(aName);
return SubscribeToFolder(nsDependentString(aName), false, nullptr);
}
NS_IMETHODIMP
nsImapIncomingServer::SubscribeToFolder(const nsAString& aName, bool subscribe, nsIURI **aUri)
@@ -2868,17 +2868,17 @@ nsresult
nsImapIncomingServer::GetFormattedStringFromName(const nsAString& aValue,
const char* aName,
nsAString& aResult)
{
nsresult rv = GetStringBundle();
if (m_stringBundle)
{
nsString tmpVal (aValue);
- const PRUnichar *formatStrings[] = { tmpVal.get() };
+ const char16_t *formatStrings[] = { tmpVal.get() };
nsString result;
rv = m_stringBundle->FormatStringFromName(
NS_ConvertASCIItoUTF16(aName).get(),
formatStrings, 1, getter_Copies(result));
aResult.Assign(result);
}
return rv;
--- a/mailnews/imap/src/nsImapIncomingServer.h
+++ b/mailnews/imap/src/nsImapIncomingServer.h
@@ -87,17 +87,17 @@ protected:
nsresult DeleteNonVerifiedFolders(nsIMsgFolder *parentFolder);
bool NoDescendentsAreVerified(nsIMsgFolder *parentFolder);
bool AllDescendentsAreNoSelect(nsIMsgFolder *parentFolder);
nsresult GetStringBundle();
static nsresult AlertUser(const nsAString& aString, nsIMsgMailNewsUrl *aUrl);
private:
- nsresult SubscribeToFolder(const PRUnichar *aName, bool subscribe);
+ nsresult SubscribeToFolder(const char16_t *aName, bool subscribe);
nsresult GetImapConnection(nsIImapUrl* aImapUrl,
nsIImapProtocol** aImapConnection);
nsresult CreateProtocolInstance(nsIImapProtocol ** aImapConnection);
nsresult CreateHostSpecificPrefName(const char *prefPrefix, nsAutoCString &prefName);
nsresult DoomUrlIfChannelHasError(nsIImapUrl *aImapUrl, bool *urlDoomed);
bool ConnectionTimeOut(nsIImapProtocol* aImapConnection);
nsresult GetFormattedStringFromName(const nsAString& aValue, const char* aName, nsAString& aResult);
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -1595,34 +1595,34 @@ NS_IMETHODIMP nsImapMailFolder::Rename (
if (msgWindow)
msgWindow->GetRootDocShell(getter_AddRefs(docShell));
if (docShell)
{
nsCOMPtr<nsIStringBundle> bundle;
rv = IMAPGetStringBundle(getter_AddRefs(bundle));
if (NS_SUCCEEDED(rv) && bundle)
{
- const PRUnichar *formatStrings[] =
+ const char16_t *formatStrings[] =
{
- (const PRUnichar*)(intptr_t)m_hierarchyDelimiter
+ (const char16_t*)(intptr_t)m_hierarchyDelimiter
};
nsString alertString;
rv = bundle->FormatStringFromName(
MOZ_UTF16("imapSpecialChar"),
formatStrings, 1, getter_Copies(alertString));
nsCOMPtr<nsIPrompt> dialog(do_GetInterface(docShell));
// setting up the dialog title
nsCOMPtr<nsIMsgIncomingServer> server;
rv = GetServer(getter_AddRefs(server));
NS_ENSURE_SUCCESS(rv, rv);
nsString dialogTitle;
nsString accountName;
rv = server->GetPrettyName(accountName);
NS_ENSURE_SUCCESS(rv, rv);
- const PRUnichar *titleParams[] = { accountName.get() };
+ const char16_t *titleParams[] = { accountName.get() };
rv = bundle->FormatStringFromName(
MOZ_UTF16("imapAlertDialogTitle"),
titleParams, 1, getter_Copies(dialogTitle));
if (dialog && !alertString.IsEmpty())
dialog->Alert(dialogTitle.get(), alertString.get());
}
}
@@ -2408,17 +2408,17 @@ nsImapMailFolder::DeleteSubFolders(nsIAr
{
nsCOMPtr<nsIStringBundle> bundle;
rv = IMAPGetStringBundle(getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString folderName;
rv = curFolder->GetName(folderName);
NS_ENSURE_SUCCESS(rv, rv);
- const PRUnichar *formatStrings[1] = { folderName.get() };
+ const char16_t *formatStrings[1] = { folderName.get() };
nsAutoString deleteFolderDialogTitle;
rv = bundle->GetStringFromName(
MOZ_UTF16("imapDeleteFolderDialogTitle"),
getter_Copies(deleteFolderDialogTitle));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString deleteFolderButtonLabel;
@@ -6009,17 +6009,17 @@ nsImapMailFolder::FillInFolderProps(nsIM
// Another user's folder, for which we couldn't find an owner name
NS_ASSERTION(false, "couldn't get owner name for other user's folder");
}
else
{
// is this right? It doesn't leak, does it?
CopyASCIItoUTF16(owner, uniOwner);
}
- const PRUnichar *params[] = { uniOwner.get() };
+ const char16_t *params[] = { uniOwner.get() };
rv = bundle->FormatStringFromName(
MOZ_UTF16("imapOtherUsersFolderTypeDescription"),
params, 1, getter_Copies(folderTypeDesc));
}
else if (GetFolderACL()->GetIsFolderShared())
{
folderTypeStringID = "imapPersonalSharedFolderTypeName";
folderTypeDescStringID = "imapPersonalSharedFolderTypeDescription";
@@ -6662,17 +6662,17 @@ nsresult nsImapMailFolder::DisplayStatus
}
}
return NS_OK;
}
NS_IMETHODIMP
nsImapMailFolder::ProgressStatusString(nsIImapProtocol* aProtocol,
const char* aMsgName,
- const PRUnichar * extraInfo)
+ const char16_t * extraInfo)
{
nsString progressMsg;
nsCOMPtr<nsIMsgIncomingServer> server;
nsresult rv = GetServer(getter_AddRefs(server));
if (NS_SUCCEEDED(rv) && server)
{
nsCOMPtr<nsIImapServerSink> serverSink = do_QueryInterface(server);
@@ -6685,30 +6685,30 @@ nsImapMailFolder::ProgressStatusString(n
if (aProtocol && !progressMsg.IsEmpty())
{
nsCOMPtr <nsIImapUrl> imapUrl;
aProtocol->GetRunningImapURL(getter_AddRefs(imapUrl));
if (imapUrl)
{
if (extraInfo)
{
- PRUnichar *printfString = nsTextFormatter::smprintf(progressMsg.get(), extraInfo);
+ char16_t *printfString = nsTextFormatter::smprintf(progressMsg.get(), extraInfo);
if (printfString)
progressMsg.Adopt(printfString);
}
DisplayStatusMsg(imapUrl, progressMsg);
}
}
return NS_OK;
}
NS_IMETHODIMP
nsImapMailFolder::PercentProgress(nsIImapProtocol* aProtocol,
- const PRUnichar * aMessage,
+ const char16_t * aMessage,
int64_t aCurrentProgress, int64_t aMaxProgress)
{
if (aProtocol)
{
nsCOMPtr <nsIImapUrl> imapUrl;
aProtocol->GetRunningImapURL(getter_AddRefs(imapUrl));
if (imapUrl)
{
@@ -8125,17 +8125,17 @@ nsImapMailFolder::CopyStreamMessage(nsIM
{
nsString dstFolderName, progressText;
GetName(dstFolderName);
nsAutoString curMsgString;
nsAutoString totalMsgString;
totalMsgString.AppendInt(m_copyState->m_totalCount);
curMsgString.AppendInt(m_copyState->m_curIndex + 1);
- const PRUnichar *formatStrings[3] = {curMsgString.get(),
+ const char16_t *formatStrings[3] = {curMsgString.get(),
totalMsgString.get(),
dstFolderName.get()
};
nsCOMPtr <nsIStringBundle> bundle;
rv = IMAPGetStringBundle(getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
rv = bundle->FormatStringFromName(
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -5036,24 +5036,24 @@ void nsImapProtocol::SetProgressString(c
m_progressString);
}
void
nsImapProtocol::ShowProgress()
{
if (!m_progressString.IsEmpty() && !m_progressStringName.IsEmpty())
{
- PRUnichar *progressString = NULL;
+ char16_t *progressString = NULL;
const char *mailboxName = GetServerStateParser().GetSelectedMailboxName();
nsString unicodeMailboxName;
nsresult rv = CopyMUTF7toUTF16(nsDependentCString(mailboxName),
unicodeMailboxName);
if (NS_SUCCEEDED(rv))
{
- // ### should convert mailboxName to PRUnichar and change %s to %S in msg text
+ // ### should convert mailboxName to char16_t and change %s to %S in msg text
progressString = nsTextFormatter::smprintf(m_progressString.get(),
unicodeMailboxName.get(), ++m_progressIndex, m_progressCount);
if (progressString)
{
PercentProgressUpdateEvent(progressString, m_progressIndex, m_progressCount);
nsTextFormatter::smprintf_free(progressString);
}
}
@@ -5080,17 +5080,17 @@ nsImapProtocol::ProgressEventFunctionUsi
nsString unicodeStr;
nsresult rv = CopyMUTF7toUTF16(nsDependentCString(aExtraInfo), unicodeStr);
if (NS_SUCCEEDED(rv))
m_imapMailFolderSink->ProgressStatusString(this, aMsgName, unicodeStr.get());
}
}
void
-nsImapProtocol::PercentProgressUpdateEvent(PRUnichar *message, int64_t currentProgress, int64_t maxProgress)
+nsImapProtocol::PercentProgressUpdateEvent(char16_t *message, int64_t currentProgress, int64_t maxProgress)
{
int64_t nowMS = 0;
int32_t percent = (100 * currentProgress) / maxProgress;
if (percent == m_lastPercent)
return; // hasn't changed, right? So just return. Do we need to clear this anywhere?
if (percent < 100) // always need to do 100%
{
@@ -7781,17 +7781,17 @@ void nsImapProtocol::Copy(const char * m
void nsImapProtocol::NthLevelChildList(const char* onlineMailboxPrefix,
int32_t depth)
{
NS_ASSERTION (depth >= 0,
"Oops ... depth must be equal or greater than 0");
if (depth < 0) return;
nsCString truncatedPrefix (onlineMailboxPrefix);
- PRUnichar slash = '/';
+ char16_t slash = '/';
if (truncatedPrefix.Last() == slash)
truncatedPrefix.SetLength(truncatedPrefix.Length()-1);
nsAutoCString pattern(truncatedPrefix);
nsAutoCString suffix;
int count = 0;
char separator = 0;
m_runningUrl->GetOnlineSubDirSeparator(&separator);
@@ -8506,17 +8506,17 @@ bool
nsImapProtocol::GetShowDeletedMessages()
{
bool rv = false;
if (m_hostSessionList)
m_hostSessionList->GetShowDeletedMessagesForHost(GetImapServerKey(), rv);
return rv;
}
-NS_IMETHODIMP nsImapProtocol::OverrideConnectionInfo(const PRUnichar *pHost, uint16_t pPort, const char *pCookieData)
+NS_IMETHODIMP nsImapProtocol::OverrideConnectionInfo(const char16_t *pHost, uint16_t pPort, const char *pCookieData)
{
m_logonHost = NS_LossyConvertUTF16toASCII(pHost);
m_logonPort = pPort;
m_logonCookie = pCookieData;
m_overRideUrlConnectionInfo = true;
return NS_OK;
}
--- a/mailnews/imap/src/nsImapProtocol.h
+++ b/mailnews/imap/src/nsImapProtocol.h
@@ -238,17 +238,17 @@ public:
void DiscoverMailboxSpec(nsImapMailboxSpec * adoptedBoxSpec);
void AlertUserEventUsingName(const char* aMessageId);
void AlertUserEvent(const char * message);
void AlertUserEventFromServer(const char * aServerEvent);
void ProgressEventFunctionUsingName(const char* aMsgId);
void ProgressEventFunctionUsingNameWithString(const char* aMsgName, const char *
aExtraInfo);
- void PercentProgressUpdateEvent(PRUnichar *message, int64_t currentProgress, int64_t maxProgress);
+ void PercentProgressUpdateEvent(char16_t *message, int64_t currentProgress, int64_t maxProgress);
void ShowProgress();
// utility function calls made by the server
void Copy(const char * messageList, const char *destinationMailbox,
bool idsAreUid);
void Search(const char * searchCriteria, bool useUID,
bool notifyHit = true);
--- a/mailnews/imap/src/nsImapServerResponseParser.cpp
+++ b/mailnews/imap/src/nsImapServerResponseParser.cpp
@@ -932,17 +932,17 @@ void nsImapServerResponseParser::mailbox
default: // (kUnknownNamespace)
break;
}
boxSpec->mNamespaceForFolder = ns;
}
// char *convertedName =
// fServerConnection.CreateUtf7ConvertedString(boxname, false);
- // PRUnichar *unicharName;
+ // char16_t *unicharName;
// unicharName = fServerConnection.CreatePRUnicharStringFromUTF7(boxname);
// PL_strfree(boxname);
// boxname = convertedName;
}
if (!boxname)
{
if (!fServerConnection.DeathSignalReceived())
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -2733,17 +2733,17 @@ NS_IMETHODIMP nsImapService::NewChannel(
nsString statusString, confirmText;
nsCOMPtr<nsIStringBundle> bundle;
rv = IMAPGetStringBundle(getter_AddRefs(bundle));
NS_ENSURE_SUCCESS(rv, rv);
// need to convert folder name from mod-utf7 to unicode
nsAutoString unescapedName;
if (NS_FAILED(CopyMUTF7toUTF16(fullFolderName, unescapedName)))
CopyASCIItoUTF16(fullFolderName, unescapedName);
- const PRUnichar *formatStrings[1] = { unescapedName.get() };
+ const char16_t *formatStrings[1] = { unescapedName.get() };
rv = bundle->FormatStringFromName(
MOZ_UTF16("imapSubscribePrompt"),
formatStrings, 1, getter_Copies(confirmText));
NS_ENSURE_SUCCESS(rv,rv);
bool confirmResult = false;
rv = dialog->Confirm(nullptr, confirmText.get(), &confirmResult);
--- a/mailnews/imap/src/nsImapStringBundle.cpp
+++ b/mailnews/imap/src/nsImapStringBundle.cpp
@@ -12,17 +12,17 @@
#include "nsIURI.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/Services.h"
#define IMAP_MSGS_URL "chrome://messenger/locale/imapMsgs.properties"
extern "C"
nsresult
-IMAPGetStringByName(const char* stringName, PRUnichar **aString)
+IMAPGetStringByName(const char* stringName, char16_t **aString)
{
nsCOMPtr <nsIStringBundle> sBundle;
nsresult rv = IMAPGetStringBundle(getter_AddRefs(sBundle));
if (NS_SUCCEEDED(rv) && sBundle)
rv = sBundle->GetStringFromName(NS_ConvertASCIItoUTF16(stringName).get(),
aString);
return rv;
}
--- a/mailnews/imap/src/nsImapStringBundle.h
+++ b/mailnews/imap/src/nsImapStringBundle.h
@@ -4,14 +4,14 @@
#ifndef _nsImapStringBundle_H__
#define _nsImapStringBundle_H__
#include "nsIStringBundle.h"
PR_BEGIN_EXTERN_C
-nsresult IMAPGetStringByName(const char* stringName, PRUnichar **aString);
+nsresult IMAPGetStringByName(const char* stringName, char16_t **aString);
nsresult IMAPGetStringBundle(nsIStringBundle **aBundle);
PR_END_EXTERN_C
#endif /* _nsImapStringBundle_H__ */
--- a/mailnews/imap/src/nsSyncRunnableHelpers.cpp
+++ b/mailnews/imap/src/nsSyncRunnableHelpers.cpp
@@ -391,18 +391,18 @@ NS_SYNCRUNNABLEMETHOD2(ImapMailFolderSin
NS_SYNCRUNNABLEMETHOD2(ImapMailFolderSink, NotifySearchHit, nsIMsgMailNewsUrl *, const char *)
NS_SYNCRUNNABLEMETHOD2(ImapMailFolderSink, CopyNextStreamMessage, bool, nsISupports *)
NS_SYNCRUNNABLEMETHOD1(ImapMailFolderSink, CloseMockChannel, nsIImapMockChannel *)
NS_SYNCRUNNABLEMETHOD5(ImapMailFolderSink, SetUrlState, nsIImapProtocol *, nsIMsgMailNewsUrl *,
bool, bool, nsresult)
NS_SYNCRUNNABLEMETHOD1(ImapMailFolderSink, ReleaseUrlCacheEntry, nsIMsgMailNewsUrl *)
NS_SYNCRUNNABLEMETHOD1(ImapMailFolderSink, HeaderFetchCompleted, nsIImapProtocol *)
NS_SYNCRUNNABLEMETHOD1(ImapMailFolderSink, SetBiffStateAndUpdate, int32_t)
-NS_SYNCRUNNABLEMETHOD3(ImapMailFolderSink, ProgressStatusString, nsIImapProtocol*, const char*, const PRUnichar *)
-NS_SYNCRUNNABLEMETHOD4(ImapMailFolderSink, PercentProgress, nsIImapProtocol*, const PRUnichar *, int64_t, int64_t)
+NS_SYNCRUNNABLEMETHOD3(ImapMailFolderSink, ProgressStatusString, nsIImapProtocol*, const char*, const char16_t *)
+NS_SYNCRUNNABLEMETHOD4(ImapMailFolderSink, PercentProgress, nsIImapProtocol*, const char16_t *, int64_t, int64_t)
NS_SYNCRUNNABLEMETHOD0(ImapMailFolderSink, ClearFolderRights)
NS_SYNCRUNNABLEMETHOD2(ImapMailFolderSink, SetCopyResponseUid, const char *, nsIImapUrl *)
NS_SYNCRUNNABLEMETHOD2(ImapMailFolderSink, SetAppendMsgUid, nsMsgKey, nsIImapUrl *)
NS_SYNCRUNNABLEMETHOD2(ImapMailFolderSink, GetMessageId, nsIImapUrl *, nsACString &)
NS_SYNCRUNNABLEMETHOD2(ImapMessageSink, SetupMsgWriteStream, nsIFile *, bool)
NS_SYNCRUNNABLEMETHOD3(ImapMessageSink, ParseAdoptedMsgLine, const char *, nsMsgKey, nsIImapUrl *)
NS_SYNCRUNNABLEMETHOD4(ImapMessageSink, NormalEndMsgWriteStream, nsMsgKey, bool, nsIImapUrl *, int32_t)
--- a/mailnews/import/applemail/src/nsAppleMailImport.cpp
+++ b/mailnews/import/applemail/src/nsAppleMailImport.cpp
@@ -66,23 +66,23 @@ nsAppleMailImportModule::~nsAppleMailImp
{
IMPORT_LOG0("nsAppleMailImportModule Deleted");
}
NS_IMPL_ISUPPORTS1(nsAppleMailImportModule, nsIImportModule)
-NS_IMETHODIMP nsAppleMailImportModule::GetName(PRUnichar **aName)
+NS_IMETHODIMP nsAppleMailImportModule::GetName(char16_t **aName)
{
return mBundle ?
mBundle->GetStringFromID(APPLEMAILIMPORT_NAME, aName) : NS_ERROR_FAILURE;
}
-NS_IMETHODIMP nsAppleMailImportModule::GetDescription(PRUnichar **aName)
+NS_IMETHODIMP nsAppleMailImportModule::GetDescription(char16_t **aName)
{
return mBundle ?
mBundle->GetStringFromID(APPLEMAILIMPORT_DESCRIPTION, aName) : NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsAppleMailImportModule::GetSupports(char **aSupports)
{
NS_ENSURE_ARG_POINTER(aSupports);
@@ -467,18 +467,18 @@ nsresult nsAppleMailImportMail::FindMbox
}
return NS_OK;
}
NS_IMETHODIMP
nsAppleMailImportMail::ImportMailbox(nsIImportMailboxDescriptor *aMailbox,
nsIMsgFolder *aDstFolder,
- PRUnichar **aErrorLog,
- PRUnichar **aSuccessLog, bool *aFatalError)
+ char16_t **aErrorLog,
+ char16_t **aSuccessLog, bool *aFatalError)
{
nsAutoString errorLog, successLog;
// reset progress
mProgress = 0;
nsAutoString mailboxName;
aMailbox->GetDisplayName(getter_Copies(mailboxName));
@@ -597,26 +597,26 @@ nsAppleMailImportMail::ImportMailbox(nsI
return NS_OK;
}
void nsAppleMailImportMail::ReportStatus(int32_t aErrorNum, nsString &aName, nsAString &aStream)
{
// get (and format, if needed) the error string from the bundle
nsAutoString outString;
- const PRUnichar *fmt = { aName.get() };
+ const char16_t *fmt = { aName.get() };
nsresult rv = mBundle->FormatStringFromID(aErrorNum, &fmt, 1, getter_Copies(outString));
// write it out the stream
if (NS_SUCCEEDED(rv)) {
aStream.Append(outString);
- aStream.Append(PRUnichar('\n'));
+ aStream.Append(char16_t('\n'));
}
}
-void nsAppleMailImportMail::SetLogs(const nsAString &aSuccess, const nsAString &aError, PRUnichar **aOutSuccess, PRUnichar **aOutError)
+void nsAppleMailImportMail::SetLogs(const nsAString &aSuccess, const nsAString &aError, char16_t **aOutSuccess, char16_t **aOutError)
{
if (aOutError && !*aOutError)
*aOutError = ToNewUnicode(aError);
if (aOutSuccess && !*aOutSuccess)
*aOutSuccess = ToNewUnicode(aSuccess);
}
NS_IMETHODIMP nsAppleMailImportMail::GetImportProgress(uint32_t *aDoneSoFar)
--- a/mailnews/import/applemail/src/nsAppleMailImport.h
+++ b/mailnews/import/applemail/src/nsAppleMailImport.h
@@ -63,16 +63,16 @@ class nsAppleMailImportMail : public nsI
private:
void FindAccountMailDirs(nsIFile *aRoot, nsIMutableArray *aMailboxDescs, nsIImportService *aImportService);
nsresult FindMboxDirs(nsIFile *aFolder, nsIMutableArray *aMailboxDescs, nsIImportService *aImportService);
nsresult AddMboxDir(nsIFile *aFolder, nsIMutableArray *aMailboxDescs, nsIImportService *aImportService);
// aInfoString is the format to a "foo %s" string. It may be NULL if the error string needs no such format.
void ReportStatus(int32_t aErrorNum, nsString &aName, nsAString &aStream);
- static void SetLogs(const nsAString& success, const nsAString& error, PRUnichar **aOutErrorLog, PRUnichar **aSuccessLog);
+ static void SetLogs(const nsAString& success, const nsAString& error, char16_t **aOutErrorLog, char16_t **aSuccessLog);
nsCOMPtr<nsIStringBundle> mBundle;
uint32_t mProgress;
uint16_t mCurDepth;
};
#endif /* nsAppleMailImport_h___ */
--- a/mailnews/import/eudora/src/nsEudoraAddress.cpp
+++ b/mailnews/import/eudora/src/nsEudoraAddress.cpp
@@ -80,17 +80,17 @@ nsEudoraAddress::nsEudoraAddress()
nsEudoraAddress::~nsEudoraAddress()
{
EmptyAliases();
}
nsresult nsEudoraAddress::ImportAddresses(uint32_t *pBytes, bool *pAbort,
- const PRUnichar *pName, nsIFile *pSrc,
+ const char16_t *pName, nsIFile *pSrc,
nsIAddrDatabase *pDb, nsString& errors)
{
// Open the source file for reading, read each line and process it!
EmptyAliases();
nsCOMPtr<nsIInputStream> inputStream;
nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inputStream), pSrc);
if (NS_FAILED(rv)) {
--- a/mailnews/import/eudora/src/nsEudoraAddress.h
+++ b/mailnews/import/eudora/src/nsEudoraAddress.h
@@ -33,17 +33,17 @@ public:
// Things that must be overridden because they are platform specific.
// retrieve the mail folder
virtual bool FindAddressFolder(nsIFile **pFolder) { return false;}
// get the list of mailboxes
virtual nsresult FindAddressBooks(nsIFile *pRoot, nsIMutableArray *pArray) { return NS_ERROR_FAILURE;}
// Non-platform specific common stuff
// import a mailbox
- nsresult ImportAddresses(uint32_t *pBytes, bool *pAbort, const PRUnichar *pName, nsIFile *pSrc, nsIAddrDatabase *pDb, nsString& errors);
+ nsresult ImportAddresses(uint32_t *pBytes, bool *pAbort, const char16_t *pName, nsIFile *pSrc, nsIAddrDatabase *pDb, nsString& errors);
private:
void EmptyAliases(void);
void ProcessLine(const char *pLine, int32_t len, nsString& errors);
int32_t CountWhiteSpace(const char *pLine, int32_t len);
CAliasEntry * ProcessAlias(const char *pLine, int32_t len, nsString& errors);
void ProcessNote(const char *pLine, int32_t len, nsString& errors);
--- a/mailnews/import/eudora/src/nsEudoraCompose.cpp
+++ b/mailnews/import/eudora/src/nsEudoraCompose.cpp
@@ -105,20 +105,20 @@ public:
/* void OnStartSending (in string aMsgID, in uint32_t aMsgSize); */
NS_IMETHOD OnStartSending(const char *aMsgID, uint32_t aMsgSize) {return NS_OK;}
/* void OnProgress (in string aMsgID, in uint32_t aProgress, in uint32_t aProgressMax); */
NS_IMETHOD OnProgress(const char *aMsgID, uint32_t aProgress, uint32_t aProgressMax) {return NS_OK;}
/* void OnStatus (in string aMsgID, in wstring aMsg); */
- NS_IMETHOD OnStatus(const char *aMsgID, const PRUnichar *aMsg) {return NS_OK;}
+ NS_IMETHOD OnStatus(const char *aMsgID, const char16_t *aMsg) {return NS_OK;}
/* void OnStopSending (in string aMsgID, in nsresult aStatus, in wstring aMsg, in nsIFile returnFile); */
- NS_IMETHOD OnStopSending(const char *aMsgID, nsresult aStatus, const PRUnichar *aMsg,
+ NS_IMETHOD OnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg,
nsIFile *returnFile) {
m_done = true;
m_location = returnFile;
return NS_OK;
}
/* void OnSendNotPerformed */
NS_IMETHOD OnSendNotPerformed(const char *aMsgID, nsresult aStatus) {return NS_OK;}
--- a/mailnews/import/eudora/src/nsEudoraFilters.cpp
+++ b/mailnews/import/eudora/src/nsEudoraFilters.cpp
@@ -54,17 +54,17 @@ nsEudoraFilters::nsEudoraFilters()
}
nsEudoraFilters::~nsEudoraFilters()
{
}
NS_IMPL_ISUPPORTS1(nsEudoraFilters, nsIImportFilters)
-NS_IMETHODIMP nsEudoraFilters::AutoLocate(PRUnichar **aDescription, nsIFile **aLocation, bool *_retval)
+NS_IMETHODIMP nsEudoraFilters::AutoLocate(char16_t **aDescription, nsIFile **aLocation, bool *_retval)
{
NS_ENSURE_ARG_POINTER(aDescription);
NS_ENSURE_ARG_POINTER(aLocation);
NS_ENSURE_ARG_POINTER(_retval);
*aDescription = nullptr;
*_retval = false;
@@ -87,17 +87,17 @@ NS_IMETHODIMP nsEudoraFilters::AutoLocat
NS_IMETHODIMP nsEudoraFilters::SetLocation(nsIFile *aLocation)
{
m_pLocation = aLocation;
return NS_OK;
}
-NS_IMETHODIMP nsEudoraFilters::Import(PRUnichar **aError, bool *_retval)
+NS_IMETHODIMP nsEudoraFilters::Import(char16_t **aError, bool *_retval)
{
NS_ENSURE_ARG_POINTER(aError);
NS_ENSURE_ARG_POINTER(_retval);
nsresult rv;
*_retval = false;
*aError = nullptr;
@@ -364,17 +364,17 @@ nsresult nsEudoraFilters::Init()
NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
rv = bundleService->CreateBundle("chrome://messenger/locale/importMsgs.properties",
getter_AddRefs(bundle));
if (NS_SUCCEEDED(rv))
{
nsAutoString Eudora(NS_LITERAL_STRING("Eudora"));
- const PRUnichar *moduleName[] = { Eudora.get() };
+ const char16_t *moduleName[] = { Eudora.get() };
rv = bundle->FormatStringFromName(MOZ_UTF16("ImportModuleFolderName"),
moduleName, 1, getter_Copies(folderName));
}
localRootFolder->GetChildNamed(folderName, getter_AddRefs(m_pMailboxesRoot));
if (!m_pMailboxesRoot)
{
// If no "Eudora Import" folder then this is a
// migration which just puts it in the root
--- a/mailnews/import/eudora/src/nsEudoraImport.cpp
+++ b/mailnews/import/eudora/src/nsEudoraImport.cpp
@@ -76,27 +76,27 @@ public:
/* void GetDefaultLocation (out nsIFile location, out boolean found, out boolean userVerify); */
NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
/* nsIArray FindMailboxes (in nsIFile location); */
NS_IMETHOD FindMailboxes(nsIFile *location, nsIArray **_retval);
NS_IMETHOD ImportMailbox(nsIImportMailboxDescriptor *source,
nsIMsgFolder *dstFolder,
- PRUnichar **pErrorLog, PRUnichar **pSuccessLog,
+ char16_t **pErrorLog, char16_t **pSuccessLog,
bool *fatalError);
/* unsigned long GetImportProgress (); */
NS_IMETHOD GetImportProgress(uint32_t *_retval);
NS_IMETHOD TranslateFolderName(const nsAString & aFolderName, nsAString & _retval);
public:
static void AddLinebreak(nsString *pStream);
- static void SetLogs(nsString& success, nsString& error, PRUnichar **pError, PRUnichar **pSuccess);
+ static void SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess);
static void ReportError(int32_t errorNum, nsString& name, nsString *pStream);
private:
static void ReportSuccess(nsString& name, int32_t count, nsString *pStream);
private:
#if defined(XP_WIN) || defined(XP_OS2)
@@ -119,38 +119,38 @@ public:
// nsISupports interface
NS_DECL_THREADSAFE_ISUPPORTS
// nsIImportAddressBooks interface
NS_IMETHOD GetSupportsMultiple(bool *_retval) { *_retval = true; return NS_OK;}
- NS_IMETHOD GetAutoFind(PRUnichar **description, bool *_retval);
+ NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval);
NS_IMETHOD GetNeedsFieldMap(nsIFile *location, bool *_retval) { *_retval = false; return NS_OK;}
NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval);
NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap)
{ return NS_ERROR_FAILURE; }
NS_IMETHOD ImportAddressBook(nsIImportABDescriptor *source,
nsIAddrDatabase *destination,
nsIImportFieldMap *fieldMap,
nsISupports *aSupportService,
- PRUnichar **errorLog,
- PRUnichar **successLog,
+ char16_t **errorLog,
+ char16_t **successLog,
bool *fatalError);
NS_IMETHOD GetImportProgress(uint32_t *_retval);
- NS_IMETHOD GetSampleData(int32_t index, bool *pFound, PRUnichar **pStr)
+ NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr)
{ return NS_ERROR_FAILURE;}
NS_IMETHOD SetSampleLocation(nsIFile *) { return NS_OK; }
private:
static void ReportSuccess(nsString& name, nsString *pStream);
private:
@@ -183,28 +183,28 @@ nsEudoraImport::~nsEudoraImport()
IMPORT_LOG0("nsEudoraImport Module Deleted\n");
}
NS_IMPL_ISUPPORTS1(nsEudoraImport, nsIImportModule)
-NS_IMETHODIMP nsEudoraImport::GetName(PRUnichar **name)
+NS_IMETHODIMP nsEudoraImport::GetName(char16_t **name)
{
NS_PRECONDITION(name != nullptr, "null ptr");
if (! name)
return NS_ERROR_NULL_POINTER;
*name = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_NAME);
return NS_OK;
}
-NS_IMETHODIMP nsEudoraImport::GetDescription(PRUnichar **name)
+NS_IMETHODIMP nsEudoraImport::GetDescription(char16_t **name)
{
NS_PRECONDITION(name != nullptr, "null ptr");
if (! name)
return NS_ERROR_NULL_POINTER;
*name = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_DESCRIPTION);
return NS_OK;
@@ -449,70 +449,70 @@ NS_IMETHODIMP ImportEudoraMailImpl::Find
array.forget(ppArray);
return NS_OK;
}
void ImportEudoraMailImpl::AddLinebreak(nsString *pStream)
{
if (pStream)
- pStream->Append(PRUnichar('\n'));
+ pStream->Append(char16_t('\n'));
}
void ImportEudoraMailImpl::ReportSuccess(nsString& name, int32_t count, nsString *pStream)
{
if (!pStream)
return;
// load the success string
- PRUnichar *pFmt = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_MAILBOX_SUCCESS);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get(), count);
+ char16_t *pFmt = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_MAILBOX_SUCCESS);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get(), count);
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsEudoraStringBundle::FreeString(pFmt);
AddLinebreak(pStream);
}
void ImportEudoraMailImpl::ReportError(int32_t errorNum, nsString& name, nsString *pStream)
{
if (!pStream)
return;
// load the error string
- PRUnichar *pFmt = nsEudoraStringBundle::GetStringByID(errorNum);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get());
+ char16_t *pFmt = nsEudoraStringBundle::GetStringByID(errorNum);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsEudoraStringBundle::FreeString(pFmt);
AddLinebreak(pStream);
}
-void ImportEudoraMailImpl::SetLogs(nsString& success, nsString& error, PRUnichar **pError, PRUnichar **pSuccess)
+void ImportEudoraMailImpl::SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess)
{
if (pError)
*pError = ToNewUnicode(error);
if (pSuccess)
*pSuccess = ToNewUnicode(success);
}
NS_IMETHODIMP
ImportEudoraMailImpl::ImportMailbox(nsIImportMailboxDescriptor *pSource,
nsIMsgFolder *pDstFolder,
- PRUnichar **pErrorLog,
- PRUnichar **pSuccessLog,
+ char16_t **pErrorLog,
+ char16_t **pSuccessLog,
bool *fatalError)
{
NS_ENSURE_ARG_POINTER(pSource);
NS_ENSURE_ARG_POINTER(pDstFolder);
NS_ENSURE_ARG_POINTER(fatalError);
nsString success;
nsString error;
bool abort = false;
nsString name;
- PRUnichar * pName;
+ char16_t * pName;
if (NS_SUCCEEDED(pSource->GetDisplayName(&pName)))
{
name = pName;
NS_Free(pName);
}
uint32_t mailSize = 0;
pSource->GetSize(&mailSize);
@@ -603,17 +603,17 @@ ImportEudoraAddressImpl::~ImportEudoraAd
{
}
NS_IMPL_ISUPPORTS1(ImportEudoraAddressImpl, nsIImportAddressBooks)
-NS_IMETHODIMP ImportEudoraAddressImpl::GetAutoFind(PRUnichar **description, bool *_retval)
+NS_IMETHODIMP ImportEudoraAddressImpl::GetAutoFind(char16_t **description, bool *_retval)
{
NS_PRECONDITION(description != nullptr, "null ptr");
NS_PRECONDITION(_retval != nullptr, "null ptr");
if (! description || !_retval)
return NS_ERROR_NULL_POINTER;
nsString str;
*_retval = false;
@@ -670,32 +670,32 @@ NS_IMETHODIMP ImportEudoraAddressImpl::F
void ImportEudoraAddressImpl::ReportSuccess(nsString& name, nsString *pStream)
{
if (!pStream)
return;
// load the success string
- PRUnichar *pFmt = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_ADDRESS_SUCCESS);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get());
+ char16_t *pFmt = nsEudoraStringBundle::GetStringByID(EUDORAIMPORT_ADDRESS_SUCCESS);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsEudoraStringBundle::FreeString(pFmt);
ImportEudoraMailImpl::AddLinebreak(pStream);
}
NS_IMETHODIMP
ImportEudoraAddressImpl::ImportAddressBook(nsIImportABDescriptor *pSource,
nsIAddrDatabase *pDestination,
nsIImportFieldMap *fieldMap,
nsISupports *aSupportService,
- PRUnichar **pErrorLog,
- PRUnichar **pSuccessLog,
+ char16_t **pErrorLog,
+ char16_t **pSuccessLog,
bool *fatalError)
{
NS_PRECONDITION(pSource != nullptr, "null ptr");
NS_PRECONDITION(pDestination != nullptr, "null ptr");
NS_PRECONDITION(fatalError != nullptr, "null ptr");
nsString success;
nsString error;
--- a/mailnews/import/eudora/src/nsEudoraMac.cpp
+++ b/mailnews/import/eudora/src/nsEudoraMac.cpp
@@ -914,17 +914,17 @@ nsresult nsEudoraMac::GetAttachmentInfo(
// Sample attachment line
// Internet:sandh.jpg (JPEG/JVWR) (0003C2E8)
OSType type = '?\??\?';
OSType creator = '?\??\?';
uint32_t fNum = 0;
int i;
- PRUnichar c;
+ char16_t c;
nsCString str(pFileName);
if (str.Length() > 22)
{
// try and extract the mac file info from the attachment line
nsCString fileNum;
nsCString types;
--- a/mailnews/import/eudora/src/nsEudoraMailbox.cpp
+++ b/mailnews/import/eudora/src/nsEudoraMailbox.cpp
@@ -194,17 +194,17 @@ nsresult nsEudoraMailbox::DeleteFile(nsI
}
return rv;
}
#define kComposeErrorStr "X-Eudora-Compose-Error: *****" "\x0D\x0A"
#define kHTMLTag "<html>"
nsresult nsEudoraMailbox::ImportMailbox(uint32_t *pBytes, bool *pAbort,
- const PRUnichar *pName, nsIFile *pSrc,
+ const char16_t *pName, nsIFile *pSrc,
nsIMsgFolder *dstFolder,
int32_t *pMsgCount)
{
nsCOMPtr<nsIFile> tocFile;
nsCOMPtr<nsIInputStream> srcInputStream;
nsCOMPtr<nsIInputStream> tocInputStream;
nsCOMPtr<nsIOutputStream> mailOutputStream;
bool importWithoutToc = true;
--- a/mailnews/import/eudora/src/nsEudoraMailbox.h
+++ b/mailnews/import/eudora/src/nsEudoraMailbox.h
@@ -144,17 +144,17 @@ public:
virtual nsresult FindMailboxes(nsIFile *pRoot, nsIMutableArray *pArray) { return NS_ERROR_FAILURE;}
// get the toc file corresponding to this mailbox
virtual nsresult FindTOCFile(nsIFile *pMailFile, nsIFile **pTOCFile, bool *pDeleteToc) { return NS_ERROR_FAILURE;}
// interpret the attachment line and return the attached file
virtual nsresult GetAttachmentInfo(const char *pFileName, nsIFile *pFile, nsCString& mimeType, nsCString& aAttachment) { return NS_ERROR_FAILURE;}
// Non-platform specific common stuff
// import a mailbox
- nsresult ImportMailbox(uint32_t *pBytes, bool *pAbort, const PRUnichar *pName,
+ nsresult ImportMailbox(uint32_t *pBytes, bool *pAbort, const char16_t *pName,
nsIFile *pSrc, nsIMsgFolder *pDst, int32_t *pMsgCount);
static int32_t IsEudoraFromSeparator(const char *pData, int32_t maxLen, nsCString& defaultDate);
static bool IsEudoraTag(const char *pChar, int32_t maxLen, bool &insideEudoraTags, nsCString &bodyType, int32_t& tagLength);
protected:
nsresult CreateTempFile(nsIFile **ppFile);
--- a/mailnews/import/eudora/src/nsEudoraSettings.cpp
+++ b/mailnews/import/eudora/src/nsEudoraSettings.cpp
@@ -43,17 +43,17 @@ nsEudoraSettings::nsEudoraSettings()
}
nsEudoraSettings::~nsEudoraSettings()
{
}
NS_IMPL_ISUPPORTS1(nsEudoraSettings, nsIImportSettings)
-NS_IMETHODIMP nsEudoraSettings::AutoLocate(PRUnichar **description, nsIFile **location, bool *_retval)
+NS_IMETHODIMP nsEudoraSettings::AutoLocate(char16_t **description, nsIFile **location, bool *_retval)
{
NS_PRECONDITION(description != nullptr, "null ptr");
NS_PRECONDITION(_retval != nullptr, "null ptr");
NS_PRECONDITION(location != nullptr, "null ptr");
if (!description || !_retval || !location)
return NS_ERROR_NULL_POINTER;
*description = nullptr;
--- a/mailnews/import/eudora/src/nsEudoraStringBundle.cpp
+++ b/mailnews/import/eudora/src/nsEudoraStringBundle.cpp
@@ -33,29 +33,29 @@ nsIStringBundle *nsEudoraStringBundle::G
m_pBundle = sBundle;
return sBundle;
}
void nsEudoraStringBundle::GetStringByID(int32_t stringID, nsString& result)
{
- PRUnichar *ptrv = GetStringByID(stringID);
+ char16_t *ptrv = GetStringByID(stringID);
result = ptrv;
FreeString(ptrv);
}
-PRUnichar *nsEudoraStringBundle::GetStringByID(int32_t stringID)
+char16_t *nsEudoraStringBundle::GetStringByID(int32_t stringID)
{
if (!m_pBundle)
m_pBundle = GetStringBundle();
if (m_pBundle)
{
- PRUnichar *ptrv = nullptr;
+ char16_t *ptrv = nullptr;
nsresult rv = m_pBundle->GetStringFromID(stringID, &ptrv);
if (NS_SUCCEEDED(rv) && ptrv)
return ptrv;
}
nsString resultString(NS_LITERAL_STRING("[StringID "));
resultString.AppendInt(stringID);
@@ -69,17 +69,17 @@ nsString nsEudoraStringBundle::FormatStr
// Yeah, I know. This causes an extra string buffer allocation, but there's no guarantee
// that nsString's free and nsTextFormatter::smprintf_free deallocate memory the same way.
nsAutoString format;
GetStringByID(stringID, format);
va_list args;
va_start(args, stringID);
- PRUnichar *pText = nsTextFormatter::vsmprintf(format.get(), args);
+ char16_t *pText = nsTextFormatter::vsmprintf(format.get(), args);
va_end(args);
nsString result(pText);
nsTextFormatter::smprintf_free(pText);
return result;
}
void nsEudoraStringBundle::Cleanup(void)
--- a/mailnews/import/eudora/src/nsEudoraStringBundle.h
+++ b/mailnews/import/eudora/src/nsEudoraStringBundle.h
@@ -7,21 +7,21 @@
#define nsEudoraStringBundle_H__
#include "nsStringGlue.h"
class nsIStringBundle;
class nsEudoraStringBundle {
public:
- static PRUnichar * GetStringByID(int32_t stringID);
+ static char16_t * GetStringByID(int32_t stringID);
static void GetStringByID(int32_t stringID, nsString& result);
static nsString FormatString(int32_t stringID, ...);
static nsIStringBundle * GetStringBundle(void); // don't release
- static void FreeString(PRUnichar *pStr) { NS_Free(pStr);}
+ static void FreeString(char16_t *pStr) { NS_Free(pStr);}
static void Cleanup(void);
private:
static nsIStringBundle * m_pBundle;
};
--- a/mailnews/import/eudora/src/nsEudoraWin32.cpp
+++ b/mailnews/import/eudora/src/nsEudoraWin32.cpp
@@ -1507,17 +1507,17 @@ nsresult nsEudoraWin32::ScanAddressDir(n
}
}
}
return rv;
}
-nsresult nsEudoraWin32::FoundAddressBook(nsIFile *file, const PRUnichar *pName, nsIMutableArray *pArray, nsIImportService *impSvc)
+nsresult nsEudoraWin32::FoundAddressBook(nsIFile *file, const char16_t *pName, nsIMutableArray *pArray, nsIImportService *impSvc)
{
nsCOMPtr<nsIImportABDescriptor> desc;
nsISupports * pInterface;
nsString name;
nsresult rv;
if (pName)
name = pName;
--- a/mailnews/import/eudora/src/nsEudoraWin32.h
+++ b/mailnews/import/eudora/src/nsEudoraWin32.h
@@ -53,17 +53,17 @@ public:
private:
nsresult ScanMailDir(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport);
nsresult IterateMailDir(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport);
nsresult ScanDescmap(nsIFile *pFolder, nsIMutableArray *pArray, nsIImportService *pImport, const char *pData, int32_t len);
nsresult FoundMailFolder(nsIFile *mailFolder, const char *pName, nsIMutableArray *pArray, nsIImportService *pImport);
nsresult FoundMailbox(nsIFile *mailFile, const char *pName, nsIMutableArray *pArray, nsIImportService *pImport);
bool FindMimeIniFile(nsIFile *pFile);
void GetMimeTypeFromExtension(nsCString& ext, nsCString& mimeType);
- nsresult FoundAddressBook(nsIFile *file, const PRUnichar *pName, nsIMutableArray *pArray, nsIImportService *impSvc);
+ nsresult FoundAddressBook(nsIFile *file, const char16_t *pName, nsIMutableArray *pArray, nsIImportService *impSvc);
nsresult ScanAddressDir(nsIFile *pDir, nsIMutableArray *pArray, nsIImportService *impSvc);
static bool FindEudoraLocation(nsIFile **pFolder, bool findIni = false);
// Settings support
static bool BuildPOPAccount(nsIMsgAccountManager *accMgr, const char *pSection, const char *pIni, nsIMsgAccount **ppAccount);
static bool BuildIMAPAccount(nsIMsgAccountManager *accMgr, const char *pSection, const char *pIni, nsIMsgAccount **ppAccount);
--- a/mailnews/import/oexpress/WabObject.cpp
+++ b/mailnews/import/oexpress/WabObject.cpp
@@ -521,17 +521,17 @@ LPSPropValue CWAB::GetUserProperty(LPMAI
void CWAB::CStrToUnicode(const char *pStr, nsString& result)
{
result.Truncate();
int wLen = MultiByteToWideChar(CP_ACP, 0, pStr, -1, m_pUniBuff, 0);
if (wLen >= m_uniBuffLen) {
if (m_pUniBuff)
delete [] m_pUniBuff;
- m_pUniBuff = new PRUnichar[wLen + 64];
+ m_pUniBuff = new char16_t[wLen + 64];
m_uniBuffLen = wLen + 64;
}
if (wLen) {
MultiByteToWideChar(CP_ACP, 0, pStr, -1, m_pUniBuff, m_uniBuffLen);
result = m_pUniBuff;
}
}
@@ -543,32 +543,32 @@ void CWAB::GetValueString(LPSPropValue p
if (!pVal)
return;
switch(PROP_TYPE(pVal->ulPropTag)) {
case PT_STRING8:
CStrToUnicode((const char *) (pVal->Value.lpszA), val);
break;
case PT_UNICODE:
- val = (PRUnichar *) (pVal->Value.lpszW);
+ val = (char16_t *) (pVal->Value.lpszW);
break;
case PT_MV_STRING8: {
nsString tmp;
ULONG j;
for(j = 0; j < pVal->Value.MVszA.cValues; j++) {
CStrToUnicode((const char *) (pVal->Value.MVszA.lppszA[j]), tmp);
val += tmp;
val.Append(NS_ConvertASCIItoUTF16(TR_OUTPUT_EOL));
}
break;
}
case PT_MV_UNICODE: {
ULONG j;
for(j = 0; j < pVal->Value.MVszW.cValues; j++) {
- val += (PRUnichar *) (pVal->Value.MVszW.lppszW[j]);
+ val += (char16_t *) (pVal->Value.MVszW.lppszW[j]);
val.Append(NS_ConvertASCIItoUTF16(TR_OUTPUT_EOL));
}
break;
}
case PT_I2:
case PT_LONG:
case PT_R4:
case PT_DOUBLE:
--- a/mailnews/import/oexpress/WabObject.h
+++ b/mailnews/import/oexpress/WabObject.h
@@ -11,18 +11,18 @@
#include "nsIFile.h"
#include <windows.h>
#include <wab.h>
class CWabIterator {
public:
- virtual nsresult EnumUser(const PRUnichar *pName, LPENTRYID pEid, ULONG cbEid) = 0;
- virtual nsresult EnumList(const PRUnichar *pName, LPENTRYID pEid, ULONG cbEid, LPMAPITABLE lpTable) = 0;
+ virtual nsresult EnumUser(const char16_t *pName, LPENTRYID pEid, ULONG cbEid) = 0;
+ virtual nsresult EnumList(const char16_t *pName, LPENTRYID pEid, ULONG cbEid, LPMAPITABLE lpTable) = 0;
};
class CWAB
{
public:
CWAB(nsIFile *fileName);
~CWAB();
@@ -45,17 +45,17 @@ public:
void CStrToUnicode(const char *pStr, nsString& result);
// Utility stuff used by iterate
void FreeProws(LPSRowSet prows);
bool IsAvailable();
private:
- PRUnichar * m_pUniBuff;
+ char16_t * m_pUniBuff;
int m_uniBuffLen;
bool m_bInitialized;
HINSTANCE m_hinstWAB;
LPWABOPEN m_lpfnWABOpen;
LPADRBOOK m_lpAdrBook;
LPWABOBJECT m_lpWABObject;
};
--- a/mailnews/import/oexpress/nsOEAddressIterator.cpp
+++ b/mailnews/import/oexpress/nsOEAddressIterator.cpp
@@ -83,17 +83,17 @@ nsOEAddressIterator::nsOEAddressIterator
m_pWab = pWab;
m_database = database;
}
nsOEAddressIterator::~nsOEAddressIterator()
{
}
-nsresult nsOEAddressIterator::EnumUser(const PRUnichar * pName, LPENTRYID pEid, ULONG cbEid)
+nsresult nsOEAddressIterator::EnumUser(const char16_t * pName, LPENTRYID pEid, ULONG cbEid)
{
IMPORT_LOG1("User: %S\n", pName);
nsresult rv = NS_OK;
if (m_database) {
LPMAILUSER pUser = m_pWab->GetUser(cbEid, pEid);
if (pUser) {
// Get a new row from the database!
@@ -123,17 +123,17 @@ nsresult nsOEAddressIterator::EnumUser(c
return rv;
}
void nsOEAddressIterator::FindListRow(nsString &eMail, nsIMdbRow **cardRow)
{
m_listRows.Get(eMail,cardRow);
}
-nsresult nsOEAddressIterator::EnumList(const PRUnichar * pName, LPENTRYID pEid, ULONG cbEid, LPMAPITABLE lpTable)
+nsresult nsOEAddressIterator::EnumList(const char16_t * pName, LPENTRYID pEid, ULONG cbEid, LPMAPITABLE lpTable)
{
// If no name provided then we're done.
if (!pName || !(*pName))
return NS_OK;
nsresult rv = NS_ERROR_FAILURE;
HRESULT hr = E_FAIL;
// Make sure we have db to work with.
@@ -255,17 +255,17 @@ void nsOEAddressIterator::SetBirthDay(ns
PR_snprintf(stringValue, sizeof(stringValue), "%04d", exploded.tm_year);
m_database->AddBirthYear(newRow, stringValue);
PR_snprintf(stringValue, sizeof(stringValue), "%02d", exploded.tm_month + 1);
m_database->AddBirthMonth(newRow, stringValue);
PR_snprintf(stringValue, sizeof(stringValue), "%02d", exploded.tm_mday);
m_database->AddBirthDay(newRow, stringValue);
}
-bool nsOEAddressIterator::BuildCard(const PRUnichar * pName, nsIMdbRow *newRow, LPMAILUSER pUser)
+bool nsOEAddressIterator::BuildCard(const char16_t * pName, nsIMdbRow *newRow, LPMAILUSER pUser)
{
nsString lastName;
nsString firstName;
nsString eMail;
nsString nickName;
nsString middleName;
PRTime birthDay = 0;
@@ -313,21 +313,21 @@ bool nsOEAddressIterator::BuildCard(cons
m_pWab->FreeProperty(pProp);
}
if (displayName.IsEmpty()) {
if (firstName.IsEmpty())
displayName = pName;
else {
displayName = firstName;
if (!middleName.IsEmpty()) {
- displayName.Append(PRUnichar(' '));
+ displayName.Append(char16_t(' '));
displayName.Append(middleName);
}
if (!lastName.IsEmpty()) {
- displayName.Append(PRUnichar(' '));
+ displayName.Append(char16_t(' '));
displayName.Append(lastName);
}
}
}
pProp = m_pWab->GetUserProperty(pUser, PR_BIRTHDAY);
if (pProp) {
m_pWab->GetValueTime(pProp, birthDay);
--- a/mailnews/import/oexpress/nsOEAddressIterator.h
+++ b/mailnews/import/oexpress/nsOEAddressIterator.h
@@ -13,22 +13,22 @@
#include "nsStringGlue.h"
#include "nsInterfaceHashtable.h"
class nsOEAddressIterator : public CWabIterator {
public:
nsOEAddressIterator(CWAB *pWab, nsIAddrDatabase *database);
~nsOEAddressIterator();
- virtual nsresult EnumUser(const PRUnichar * pName, LPENTRYID pEid, ULONG cbEid) MOZ_OVERRIDE;
- virtual nsresult EnumList(const PRUnichar * pName, LPENTRYID pEid, ULONG cbEid, LPMAPITABLE table) MOZ_OVERRIDE;
+ virtual nsresult EnumUser(const char16_t * pName, LPENTRYID pEid, ULONG cbEid) MOZ_OVERRIDE;
+ virtual nsresult EnumList(const char16_t * pName, LPENTRYID pEid, ULONG cbEid, LPMAPITABLE table) MOZ_OVERRIDE;
void FindListRow(nsString &eMail, nsIMdbRow **cardRow);
private:
- bool BuildCard(const PRUnichar * pName, nsIMdbRow *card, LPMAILUSER pUser);
+ bool BuildCard(const char16_t * pName, nsIMdbRow *card, LPMAILUSER pUser);
void SanitizeValue(nsString& val);
void SplitString(nsString& val1, nsString& val2);
void SetBirthDay(nsIMdbRow *card, PRTime& birthDay);
CWAB * m_pWab;
nsCOMPtr<nsIAddrDatabase> m_database;
nsInterfaceHashtable <nsStringHashKey, nsIMdbRow> m_listRows;
};
--- a/mailnews/import/oexpress/nsOEImport.cpp
+++ b/mailnews/import/oexpress/nsOEImport.cpp
@@ -67,29 +67,29 @@ public:
/* void GetDefaultLocation (out nsIFile location, out boolean found, out boolean userVerify); */
NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
/* nsIArray FindMailboxes (in nsIFile location); */
NS_IMETHOD FindMailboxes(nsIFile *location, nsIArray **_retval);
NS_IMETHOD ImportMailbox(nsIImportMailboxDescriptor *source,
nsIMsgFolder *dstFolder,
- PRUnichar **pErrorLog, PRUnichar **pSuccessLog,
+ char16_t **pErrorLog, char16_t **pSuccessLog,
bool *fatalError);
/* unsigned long GetImportProgress (); */
NS_IMETHOD GetImportProgress(uint32_t *_retval);
NS_IMETHOD TranslateFolderName(const nsAString & aFolderName, nsAString & _retval);
public:
static void ReportSuccess(nsString& name, int32_t count, nsString *pStream);
static void ReportError(int32_t errorNum, nsString& name, nsString *pStream);
static void AddLinebreak(nsString *pStream);
- static void SetLogs(nsString& success, nsString& error, PRUnichar **pError, PRUnichar **pSuccess);
+ static void SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess);
private:
uint32_t m_bytesDone;
};
class ImportOEAddressImpl : public nsIImportAddressBooks
{
@@ -101,38 +101,38 @@ public:
// nsISupports interface
NS_DECL_THREADSAFE_ISUPPORTS
// nsIImportAddressBooks interface
NS_IMETHOD GetSupportsMultiple(bool *_retval) { *_retval = false; return NS_OK;}
- NS_IMETHOD GetAutoFind(PRUnichar **description, bool *_retval);
+ NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval);
NS_IMETHOD GetNeedsFieldMap(nsIFile *pLoc, bool *_retval) { *_retval = false; return NS_OK;}
NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval);
NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap)
{ return NS_ERROR_FAILURE; }
NS_IMETHOD ImportAddressBook(nsIImportABDescriptor *source,
nsIAddrDatabase *destination,
nsIImportFieldMap *fieldMap,
nsISupports *aSupportService,
- PRUnichar **errorLog,
- PRUnichar **successLog,
+ char16_t **errorLog,
+ char16_t **successLog,
bool *fatalError);
NS_IMETHOD GetImportProgress(uint32_t *_retval);
- NS_IMETHOD GetSampleData(int32_t index, bool *pFound, PRUnichar **pStr)
+ NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr)
{ return NS_ERROR_FAILURE;}
NS_IMETHOD SetSampleLocation(nsIFile *) { return NS_OK; }
private:
static void ReportSuccess(nsString& name, nsString *pStream);
private:
@@ -157,26 +157,26 @@ nsOEImport::nsOEImport()
nsOEImport::~nsOEImport()
{
IMPORT_LOG0("nsOEImport Module Deleted\n");
}
NS_IMPL_ISUPPORTS1(nsOEImport, nsIImportModule)
-NS_IMETHODIMP nsOEImport::GetName(PRUnichar **name)
+NS_IMETHODIMP nsOEImport::GetName(char16_t **name)
{
NS_ENSURE_ARG_POINTER(name);
*name = nsOEStringBundle::GetStringByID(OEIMPORT_NAME);
return NS_OK;
}
-NS_IMETHODIMP nsOEImport::GetDescription(PRUnichar **name)
+NS_IMETHODIMP nsOEImport::GetDescription(char16_t **name)
{
NS_ENSURE_ARG_POINTER(name);
*name = nsOEStringBundle::GetStringByID(OEIMPORT_DESCRIPTION);
return NS_OK;
}
NS_IMETHODIMP nsOEImport::GetSupports(char **supports)
@@ -346,58 +346,58 @@ NS_IMETHODIMP ImportOEMailImpl::FindMail
*ppArray = nullptr;
return NS_OK;
}
void ImportOEMailImpl::AddLinebreak(nsString *pStream)
{
if (pStream)
- pStream->Append(PRUnichar('\n'));
+ pStream->Append(char16_t('\n'));
}
void ImportOEMailImpl::ReportSuccess(nsString& name, int32_t count, nsString *pStream)
{
if (!pStream)
return;
// load the success string
- PRUnichar *pFmt = nsOEStringBundle::GetStringByID(OEIMPORT_MAILBOX_SUCCESS);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get(), count);
+ char16_t *pFmt = nsOEStringBundle::GetStringByID(OEIMPORT_MAILBOX_SUCCESS);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get(), count);
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsOEStringBundle::FreeString(pFmt);
AddLinebreak(pStream);
}
void ImportOEMailImpl::ReportError(int32_t errorNum, nsString& name, nsString *pStream)
{
if (!pStream)
return;
// load the error string
- PRUnichar *pFmt = nsOEStringBundle::GetStringByID(errorNum);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get());
+ char16_t *pFmt = nsOEStringBundle::GetStringByID(errorNum);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsOEStringBundle::FreeString(pFmt);
AddLinebreak(pStream);
}
-void ImportOEMailImpl::SetLogs(nsString& success, nsString& error, PRUnichar **pError, PRUnichar **pSuccess)
+void ImportOEMailImpl::SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess)
{
if (pError)
*pError = ToNewUnicode(error);
if (pSuccess)
*pSuccess = ToNewUnicode(success);
}
NS_IMETHODIMP ImportOEMailImpl::ImportMailbox(nsIImportMailboxDescriptor *pSource,
nsIMsgFolder *dstFolder,
- PRUnichar **pErrorLog,
- PRUnichar **pSuccessLog,
+ char16_t **pErrorLog,
+ char16_t **pSuccessLog,
bool *fatalError)
{
NS_ENSURE_ARG_POINTER(pSource);
NS_ENSURE_ARG_POINTER(dstFolder);
NS_ENSURE_ARG_POINTER(fatalError);
nsString success;
nsString error;
@@ -501,17 +501,17 @@ NS_IMETHODIMP ImportOEAddressImpl::GetDe
// So we set a fake location here.
if (NS_SUCCEEDED(NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR, aLocation)))
*aUserVerify = false;
}
return NS_OK;
}
-NS_IMETHODIMP ImportOEAddressImpl::GetAutoFind(PRUnichar **description, bool *_retval)
+NS_IMETHODIMP ImportOEAddressImpl::GetAutoFind(char16_t **description, bool *_retval)
{
NS_PRECONDITION(description != nullptr, "null ptr");
NS_PRECONDITION(_retval != nullptr, "null ptr");
if (! description || !_retval)
return NS_ERROR_NULL_POINTER;
*_retval = false;
nsString str;
@@ -585,18 +585,18 @@ NS_IMETHODIMP ImportOEAddressImpl::FindA
}
NS_IMETHODIMP ImportOEAddressImpl::ImportAddressBook(nsIImportABDescriptor *source,
nsIAddrDatabase *destination,
nsIImportFieldMap *fieldMap,
nsISupports *aSupportService,
- PRUnichar **errorLog,
- PRUnichar **successLog,
+ char16_t **errorLog,
+ char16_t **successLog,
bool *fatalError)
{
NS_PRECONDITION(source != nullptr, "null ptr");
// NS_PRECONDITION(destination != nullptr, "null ptr");
// NS_PRECONDITION(fieldMap != nullptr, "null ptr");
NS_PRECONDITION(fatalError != nullptr, "null ptr");
if (!source || !fatalError)
return NS_ERROR_NULL_POINTER;
@@ -648,15 +648,15 @@ NS_IMETHODIMP ImportOEAddressImpl::GetIm
return NS_OK;
}
void ImportOEAddressImpl::ReportSuccess(nsString& name, nsString *pStream)
{
if (!pStream)
return;
// load the success string
- PRUnichar *pFmt = nsOEStringBundle::GetStringByID(OEIMPORT_ADDRESS_SUCCESS);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get());
+ char16_t *pFmt = nsOEStringBundle::GetStringByID(OEIMPORT_ADDRESS_SUCCESS);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsOEStringBundle::FreeString(pFmt);
ImportOEMailImpl::AddLinebreak(pStream);
}
--- a/mailnews/import/oexpress/nsOEScanBoxes.cpp
+++ b/mailnews/import/oexpress/nsOEScanBoxes.cpp
@@ -247,17 +247,17 @@ bool nsOEScanBoxes::FindMailBoxes(nsIFil
delete pEntry;
return false;
}
#ifdef _TRACE_MAILBOX_ENTRIES
IMPORT_LOG0("------------\n");
IMPORT_LOG2(" Offset: %lx, index: %ld\n", curRec, pEntry->index);
IMPORT_LOG2(" previous: %lx, next: %lx\n", previous, next);
- IMPORT_LOG2(" Name: %S, File: %s\n", (PRUnichar *) pEntry->mailName, (const char *) pEntry->fileName);
+ IMPORT_LOG2(" Name: %S, File: %s\n", (char16_t *) pEntry->mailName, (const char *) pEntry->fileName);
IMPORT_LOG3(" Parent: %ld, Child: %ld, Sibling: %ld\n", pEntry->parent, pEntry->child, pEntry->sibling);
#endif
if (!StringEndsWith(pEntry->fileName, NS_LITERAL_CSTRING(".mbx")))
pEntry->fileName.Append(".mbx");
m_entryArray.AppendElement(pEntry);
@@ -727,17 +727,17 @@ void nsOEScanBoxes::BuildMailboxList(Mai
nsCOMPtr<nsIImportService> impSvc(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS_VOID(rv);
while (pBox) {
rv = impSvc->CreateNewMailboxDescriptor(&pID);
if (NS_SUCCEEDED(rv)) {
pID->SetDepth(depth);
pID->SetIdentifier(pBox->index);
- pID->SetDisplayName((PRUnichar *)pBox->mailName.get());
+ pID->SetDisplayName((char16_t *)pBox->mailName.get());
if (!pBox->fileName.IsEmpty()) {
pID->GetFile(getter_AddRefs(file));
file->InitWithFile(root);
file->AppendNative(pBox->fileName);
size = 0;
file->GetFileSize(&size);
pID->SetSize(size);
}
--- a/mailnews/import/oexpress/nsOESettings.cpp
+++ b/mailnews/import/oexpress/nsOESettings.cpp
@@ -113,17 +113,17 @@ nsOESettings::nsOESettings()
}
nsOESettings::~nsOESettings()
{
}
NS_IMPL_ISUPPORTS1(nsOESettings, nsIImportSettings)
-NS_IMETHODIMP nsOESettings::AutoLocate(PRUnichar **description, nsIFile **location, bool *_retval)
+NS_IMETHODIMP nsOESettings::AutoLocate(char16_t **description, nsIFile **location, bool *_retval)
{
NS_PRECONDITION(description != nullptr, "null ptr");
NS_PRECONDITION(_retval != nullptr, "null ptr");
if (!description || !_retval)
return NS_ERROR_NULL_POINTER;
*description = nsOEStringBundle::GetStringByID(OEIMPORT_NAME);
--- a/mailnews/import/oexpress/nsOEStringBundle.cpp
+++ b/mailnews/import/oexpress/nsOEStringBundle.cpp
@@ -33,27 +33,27 @@ nsIStringBundle *nsOEStringBundle::GetSt
m_pBundle = sBundle;
return sBundle;
}
void nsOEStringBundle::GetStringByID(int32_t stringID, nsString& result)
{
- PRUnichar *ptrv = GetStringByID(stringID);
+ char16_t *ptrv = GetStringByID(stringID);
result.Adopt(ptrv);
}
-PRUnichar *nsOEStringBundle::GetStringByID(int32_t stringID)
+char16_t *nsOEStringBundle::GetStringByID(int32_t stringID)
{
if (!m_pBundle)
m_pBundle = GetStringBundle();
if (m_pBundle) {
- PRUnichar *ptrv = nullptr;
+ char16_t *ptrv = nullptr;
nsresult rv = m_pBundle->GetStringFromID(stringID, &ptrv);
if (NS_SUCCEEDED(rv) && ptrv)
return ptrv;
}
nsString resultString;
resultString.AppendLiteral("[StringID ");
--- a/mailnews/import/oexpress/nsOEStringBundle.h
+++ b/mailnews/import/oexpress/nsOEStringBundle.h
@@ -6,20 +6,20 @@
#define _nsOEStringBundle_H__
#include "nsStringGlue.h"
class nsIStringBundle;
class nsOEStringBundle {
public:
- static PRUnichar * GetStringByID(int32_t stringID);
+ static char16_t * GetStringByID(int32_t stringID);
static void GetStringByID(int32_t stringID, nsString& result);
static nsIStringBundle * GetStringBundle(void); // don't release
- static void FreeString(PRUnichar *pStr) { NS_Free(pStr);}
+ static void FreeString(char16_t *pStr) { NS_Free(pStr);}
static void Cleanup(void);
private:
static nsIStringBundle * m_pBundle;
};
--- a/mailnews/import/outlook/src/MapiApi.cpp
+++ b/mailnews/import/outlook/src/MapiApi.cpp
@@ -15,17 +15,17 @@
#include "nsUnicharUtils.h"
int CMapiApi::m_clients = 0;
BOOL CMapiApi::m_initialized = false;
nsVoidArray *CMapiApi::m_pStores = NULL;
LPMAPISESSION CMapiApi::m_lpSession = NULL;
LPMDB CMapiApi::m_lpMdb = NULL;
HRESULT CMapiApi::m_lastError;
-PRUnichar * CMapiApi::m_pUniBuff = NULL;
+char16_t * CMapiApi::m_pUniBuff = NULL;
int CMapiApi::m_uniBuffLen = 0;
/*
Type: 1, name: Calendar, class: IPF.Appointment
Type: 1, name: Contacts, class: IPF.Contact
Type: 1, name: Journal, class: IPF.Journal
Type: 1, name: Notes, class: IPF.StickyNote
Type: 1, name: Tasks, class: IPF.Task
Type: 1, name: Drafts, class: IPF.Note
@@ -295,17 +295,17 @@ CMapiApi::~CMapiApi()
void CMapiApi::CStrToUnicode(const char *pStr, nsString& result)
{
result.Truncate();
int wLen = MultiByteToWideChar(CP_ACP, 0, pStr, -1, m_pUniBuff, 0);
if (wLen >= m_uniBuffLen) {
if (m_pUniBuff)
delete [] m_pUniBuff;
- m_pUniBuff = new PRUnichar[wLen + 64];
+ m_pUniBuff = new char16_t[wLen + 64];
m_uniBuffLen = wLen + 64;
}
if (wLen) {
MultiByteToWideChar(CP_ACP, 0, pStr, -1, m_pUniBuff, m_uniBuffLen);
result = m_pUniBuff;
}
}
@@ -362,33 +362,33 @@ BOOL CMapiApi::LogOn(void)
class CGetStoreFoldersIter : public CMapiHierarchyIter {
public:
CGetStoreFoldersIter(CMapiApi *pApi, CMapiFolderList& folders, int depth, BOOL isMail = TRUE);
virtual BOOL HandleHierarchyItem(ULONG oType, ULONG cb, LPENTRYID pEntry);
protected:
- BOOL ExcludeFolderClass(const PRUnichar *pName);
+ BOOL ExcludeFolderClass(const char16_t *pName);
BOOL m_isMail;
CMapiApi * m_pApi;
CMapiFolderList * m_pList;
int m_depth;
};
CGetStoreFoldersIter::CGetStoreFoldersIter(CMapiApi *pApi, CMapiFolderList& folders, int depth, BOOL isMail)
{
m_pApi = pApi;
m_pList = &folders;
m_depth = depth;
m_isMail = isMail;
}
-BOOL CGetStoreFoldersIter::ExcludeFolderClass(const PRUnichar *pName)
+BOOL CGetStoreFoldersIter::ExcludeFolderClass(const char16_t *pName)
{
BOOL bResult;
nsDependentString pNameStr(pName);
if (m_isMail) {
bResult = FALSE;
if (pNameStr.EqualsLiteral("IPF.Appointment"))
bResult = TRUE;
else if (pNameStr.EqualsLiteral("IPF.Contact"))
@@ -982,17 +982,17 @@ BOOL CMapiApi::IterateStores(CMapiFolder
// does not exist, then szContents will be zero. We'll
// assume that any store that doesn't have anything in
// it's hierarchy tree is not a store we want to import -
// there would be nothing to import from anyway!
// Currently, this does exclude IMAP server accounts
// which is the desired behaviour.
int strLen = strlen(lpStr);
- PRUnichar * pwszStr = (PRUnichar *) nsMemory::Alloc((strLen + 1) * sizeof(WCHAR));
+ char16_t * pwszStr = (char16_t *) nsMemory::Alloc((strLen + 1) * sizeof(WCHAR));
if (!pwszStr) {
// out of memory
FreeProws(lpRow);
lpTable->Release();
return FALSE;
}
::MultiByteToWideChar(CP_ACP, 0, lpStr, strlen(lpStr) + 1, pwszStr, (strLen + 1) * sizeof(WCHAR));
CMapiFolder *pFolder = new CMapiFolder(pwszStr, cbEID, lpEID, 0, MAPI_STORE);
@@ -1310,17 +1310,17 @@ BOOL CMapiApi::GetStringFromProp(LPSProp
BOOL CMapiApi::GetStringFromProp(LPSPropValue pVal, nsString& val, BOOL delVal)
{
BOOL bResult = TRUE;
if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_STRING8)) {
CStrToUnicode((const char *)pVal->Value.lpszA, val);
}
else if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_UNICODE)) {
- val = (PRUnichar *) pVal->Value.lpszW;
+ val = (char16_t *) pVal->Value.lpszW;
}
else if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_NULL)) {
val.Truncate();
}
else if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_ERROR)) {
val.Truncate();
bResult = FALSE;
}
@@ -1549,17 +1549,17 @@ void CMapiFolderList::AddItem(CMapiFolde
}
void CMapiFolderList::ChangeName(nsString& name)
{
if (name.IsEmpty()) {
name.AssignLiteral("1");
return;
}
- PRUnichar lastC = name.Last();
+ char16_t lastC = name.Last();
if ((lastC >= '0') && (lastC <= '9')) {
lastC++;
if (lastC > '9') {
lastC = '1';
name.SetCharAt(lastC, name.Length() - 1);
name.AppendLiteral("0");
}
else {
@@ -1679,17 +1679,17 @@ CMapiFolder::CMapiFolder()
{
m_objectType = MAPI_FOLDER;
m_cbEid = 0;
m_lpEid = NULL;
m_depth = 0;
m_doImport = TRUE;
}
-CMapiFolder::CMapiFolder(const PRUnichar *pDisplayName, ULONG cbEid, LPENTRYID lpEid, int depth, LONG oType)
+CMapiFolder::CMapiFolder(const char16_t *pDisplayName, ULONG cbEid, LPENTRYID lpEid, int depth, LONG oType)
{
m_cbEid = 0;
m_lpEid = NULL;
SetDisplayName(pDisplayName);
SetEntryID(cbEid, lpEid);
SetDepth(depth);
SetObjectType(oType);
SetDoImport(TRUE);
--- a/mailnews/import/outlook/src/MapiApi.h
+++ b/mailnews/import/outlook/src/MapiApi.h
@@ -145,35 +145,35 @@ protected:
private:
static int m_clients;
static BOOL m_initialized;
static nsVoidArray * m_pStores;
static LPMAPISESSION m_lpSession;
static LPMDB m_lpMdb;
static HRESULT m_lastError;
- static PRUnichar * m_pUniBuff;
+ static char16_t * m_pUniBuff;
static int m_uniBuffLen;
static BOOL GetLargeProperty(LPMAPIPROP pProp, ULONG tag, void** result);
};
class CMapiFolder {
public:
CMapiFolder();
CMapiFolder(const CMapiFolder *pCopyFrom);
- CMapiFolder(const PRUnichar *pDisplayName, ULONG cbEid, LPENTRYID lpEid, int depth, LONG oType = MAPI_FOLDER);
+ CMapiFolder(const char16_t *pDisplayName, ULONG cbEid, LPENTRYID lpEid, int depth, LONG oType = MAPI_FOLDER);
~CMapiFolder();
void SetDoImport(BOOL doIt) { m_doImport = doIt;}
void SetObjectType(long oType) { m_objectType = oType;}
- void SetDisplayName(const PRUnichar *pDisplayName) { m_displayName = pDisplayName;}
+ void SetDisplayName(const char16_t *pDisplayName) { m_displayName = pDisplayName;}
void SetEntryID(ULONG cbEid, LPENTRYID lpEid);
void SetDepth(int depth) { m_depth = depth;}
- void SetFilePath(const PRUnichar *pFilePath) { m_mailFilePath = pFilePath;}
+ void SetFilePath(const char16_t *pFilePath) { m_mailFilePath = pFilePath;}
BOOL GetDoImport(void) const { return m_doImport;}
LONG GetObjectType(void) const { return m_objectType;}
void GetDisplayName(nsString& name) const { name = m_displayName;}
void GetFilePath(nsString& path) const { path = m_mailFilePath;}
BOOL IsStore(void) const { return m_objectType == MAPI_STORE;}
BOOL IsFolder(void) const { return m_objectType == MAPI_FOLDER;}
int GetDepth(void) const { return m_depth;}
--- a/mailnews/import/outlook/src/nsOutlookCompose.cpp
+++ b/mailnews/import/outlook/src/nsOutlookCompose.cpp
@@ -127,20 +127,20 @@ public:
/* void OnStartSending (in string aMsgID, in uint32_t aMsgSize); */
NS_IMETHOD OnStartSending(const char *aMsgID, uint32_t aMsgSize) {return NS_OK;}
/* void OnProgress (in string aMsgID, in uint32_t aProgress, in uint32_t aProgressMax); */
NS_IMETHOD OnProgress(const char *aMsgID, uint32_t aProgress, uint32_t aProgressMax) {return NS_OK;}
/* void OnStatus (in string aMsgID, in wstring aMsg); */
- NS_IMETHOD OnStatus(const char *aMsgID, const PRUnichar *aMsg) {return NS_OK;}
+ NS_IMETHOD OnStatus(const char *aMsgID, const char16_t *aMsg) {return NS_OK;}
/* void OnStopSending (in string aMsgID, in nsresult aStatus, in wstring aMsg, in nsIFile returnFile); */
- NS_IMETHOD OnStopSending(const char *aMsgID, nsresult aStatus, const PRUnichar *aMsg,
+ NS_IMETHOD OnStopSending(const char *aMsgID, nsresult aStatus, const char16_t *aMsg,
nsIFile *returnFile) {
m_done = true;
NS_IF_ADDREF(m_location = returnFile);
return NS_OK;
}
/* void OnSendNotPerformed */
NS_IMETHOD OnSendNotPerformed(const char *aMsgID, nsresult aStatus) {return NS_OK;}
--- a/mailnews/import/outlook/src/nsOutlookImport.cpp
+++ b/mailnews/import/outlook/src/nsOutlookImport.cpp
@@ -60,29 +60,29 @@ public:
/* void GetDefaultLocation (out nsIFile location, out boolean found, out boolean userVerify); */
NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify);
/* nsIArray FindMailboxes (in nsIFile location); */
NS_IMETHOD FindMailboxes(nsIFile *location, nsIArray **_retval);
NS_IMETHOD ImportMailbox(nsIImportMailboxDescriptor *source,
nsIMsgFolder *dstFolder,
- PRUnichar **pErrorLog, PRUnichar **pSuccessLog,
+ char16_t **pErrorLog, char16_t **pSuccessLog,
bool *fatalError);
/* unsigned long GetImportProgress (); */
NS_IMETHOD GetImportProgress(uint32_t *_retval);
NS_IMETHOD TranslateFolderName(const nsAString & aFolderName, nsAString & _retval);
public:
static void ReportSuccess(nsString& name, int32_t count, nsString *pStream);
static void ReportError(int32_t errorNum, nsString& name, nsString *pStream);
static void AddLinebreak(nsString *pStream);
- static void SetLogs(nsString& success, nsString& error, PRUnichar **pError, PRUnichar **pSuccess);
+ static void SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess);
private:
nsOutlookMail m_mail;
uint32_t m_bytesDone;
};
class ImportOutlookAddressImpl : public nsIImportAddressBooks
@@ -95,39 +95,39 @@ public:
// nsISupports interface
NS_DECL_THREADSAFE_ISUPPORTS
// nsIImportAddressBooks interface
NS_IMETHOD GetSupportsMultiple(bool *_retval) { *_retval = true; return NS_OK;}
- NS_IMETHOD GetAutoFind(PRUnichar **description, bool *_retval);
+ NS_IMETHOD GetAutoFind(char16_t **description, bool *_retval);
NS_IMETHOD GetNeedsFieldMap(nsIFile *location, bool *_retval) { *_retval = false; return NS_OK;}
NS_IMETHOD GetDefaultLocation(nsIFile **location, bool *found, bool *userVerify)
{ return NS_ERROR_FAILURE;}
NS_IMETHOD FindAddressBooks(nsIFile *location, nsIArray **_retval);
NS_IMETHOD InitFieldMap(nsIImportFieldMap *fieldMap)
{ return NS_ERROR_FAILURE; }
NS_IMETHOD ImportAddressBook(nsIImportABDescriptor *source,
nsIAddrDatabase *destination,
nsIImportFieldMap *fieldMap,
nsISupports *aSupportService,
- PRUnichar **errorLog,
- PRUnichar **successLog,
+ char16_t **errorLog,
+ char16_t **successLog,
bool *fatalError);
NS_IMETHOD GetImportProgress(uint32_t *_retval);
- NS_IMETHOD GetSampleData(int32_t index, bool *pFound, PRUnichar **pStr)
+ NS_IMETHOD GetSampleData(int32_t index, bool *pFound, char16_t **pStr)
{ return NS_ERROR_FAILURE;}
NS_IMETHOD SetSampleLocation(nsIFile *) { return NS_OK; }
private:
void ReportSuccess(nsString& name, nsString *pStream);
private:
@@ -155,27 +155,27 @@ nsOutlookImport::nsOutlookImport()
nsOutlookImport::~nsOutlookImport()
{
IMPORT_LOG0("nsOutlookImport Module Deleted\n");
}
NS_IMPL_ISUPPORTS1(nsOutlookImport, nsIImportModule)
-NS_IMETHODIMP nsOutlookImport::GetName(PRUnichar **name)
+NS_IMETHODIMP nsOutlookImport::GetName(char16_t **name)
{
NS_PRECONDITION(name != nullptr, "null ptr");
if (! name)
return NS_ERROR_NULL_POINTER;
*name = nsOutlookStringBundle::GetStringByID(OUTLOOKIMPORT_NAME);
return NS_OK;
}
-NS_IMETHODIMP nsOutlookImport::GetDescription(PRUnichar **name)
+NS_IMETHODIMP nsOutlookImport::GetDescription(char16_t **name)
{
NS_PRECONDITION(name != nullptr, "null ptr");
if (!name)
return NS_ERROR_NULL_POINTER;
*name = nsOutlookStringBundle::GetStringByID(OUTLOOKIMPORT_DESCRIPTION);
return NS_OK;
@@ -345,70 +345,70 @@ NS_IMETHODIMP ImportOutlookMailImpl::Fin
if (!pLoc || !ppArray)
return NS_ERROR_NULL_POINTER;
return m_mail.GetMailFolders(ppArray);
}
void ImportOutlookMailImpl::AddLinebreak(nsString *pStream)
{
if (pStream)
- pStream->Append(PRUnichar('\n'));
+ pStream->Append(char16_t('\n'));
}
void ImportOutlookMailImpl::ReportSuccess(nsString& name, int32_t count, nsString *pStream)
{
if (!pStream)
return;
// load the success string
- PRUnichar *pFmt = nsOutlookStringBundle::GetStringByID(OUTLOOKIMPORT_MAILBOX_SUCCESS);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get(), count);
+ char16_t *pFmt = nsOutlookStringBundle::GetStringByID(OUTLOOKIMPORT_MAILBOX_SUCCESS);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get(), count);
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsOutlookStringBundle::FreeString(pFmt);
AddLinebreak(pStream);
}
void ImportOutlookMailImpl::ReportError(int32_t errorNum, nsString& name, nsString *pStream)
{
if (!pStream)
return;
// load the error string
- PRUnichar *pFmt = nsOutlookStringBundle::GetStringByID(errorNum);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get());
+ char16_t *pFmt = nsOutlookStringBundle::GetStringByID(errorNum);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsOutlookStringBundle::FreeString(pFmt);
AddLinebreak(pStream);
}
-void ImportOutlookMailImpl::SetLogs(nsString& success, nsString& error, PRUnichar **pError, PRUnichar **pSuccess)
+void ImportOutlookMailImpl::SetLogs(nsString& success, nsString& error, char16_t **pError, char16_t **pSuccess)
{
if (pError)
*pError = ToNewUnicode(error);
if (pSuccess)
*pSuccess = ToNewUnicode(success);
}
NS_IMETHODIMP
ImportOutlookMailImpl::ImportMailbox(nsIImportMailboxDescriptor *pSource,
nsIMsgFolder *dstFolder,
- PRUnichar **pErrorLog,
- PRUnichar **pSuccessLog,
+ char16_t **pErrorLog,
+ char16_t **pSuccessLog,
bool *fatalError)
{
NS_ENSURE_ARG_POINTER(pSource);
NS_ENSURE_ARG_POINTER(dstFolder);
NS_ENSURE_ARG_POINTER(fatalError);
nsString success;
nsString error;
bool abort = false;
nsString name;
- PRUnichar *pName;
+ char16_t *pName;
if (NS_SUCCEEDED( pSource->GetDisplayName( &pName))) {
name = pName;
NS_Free( pName);
}
uint32_t mailSize = 0;
pSource->GetSize(&mailSize);
if (mailSize == 0) {
@@ -482,17 +482,17 @@ ImportOutlookAddressImpl::ImportOutlookA
}
ImportOutlookAddressImpl::~ImportOutlookAddressImpl()
{
}
NS_IMPL_ISUPPORTS1(ImportOutlookAddressImpl, nsIImportAddressBooks)
-NS_IMETHODIMP ImportOutlookAddressImpl::GetAutoFind(PRUnichar **description, bool *_retval)
+NS_IMETHODIMP ImportOutlookAddressImpl::GetAutoFind(char16_t **description, bool *_retval)
{
NS_PRECONDITION(description != nullptr, "null ptr");
NS_PRECONDITION(_retval != nullptr, "null ptr");
if (! description || !_retval)
return NS_ERROR_NULL_POINTER;
*_retval = true;
nsString str;
@@ -509,18 +509,18 @@ NS_IMETHODIMP ImportOutlookAddressImpl::
return m_address.GetAddressBooks(_retval);
}
NS_IMETHODIMP ImportOutlookAddressImpl::ImportAddressBook(nsIImportABDescriptor *source,
nsIAddrDatabase *destination,
nsIImportFieldMap *fieldMap,
nsISupports *aSupportService,
- PRUnichar **pErrorLog,
- PRUnichar **pSuccessLog,
+ char16_t **pErrorLog,
+ char16_t **pSuccessLog,
bool *fatalError)
{
m_msgCount = 0;
m_msgTotal = 0;
NS_PRECONDITION(source != nullptr, "null ptr");
NS_PRECONDITION(destination != nullptr, "null ptr");
NS_PRECONDITION(fatalError != nullptr, "null ptr");
@@ -580,15 +580,15 @@ NS_IMETHODIMP ImportOutlookAddressImpl::
return NS_OK;
}
void ImportOutlookAddressImpl::ReportSuccess(nsString& name, nsString *pStream)
{
if (!pStream)
return;
// load the success string
- PRUnichar *pFmt = nsOutlookStringBundle::GetStringByID(OUTLOOKIMPORT_ADDRESS_SUCCESS);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, name.get());
+ char16_t *pFmt = nsOutlookStringBundle::GetStringByID(OUTLOOKIMPORT_ADDRESS_SUCCESS);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, name.get());
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
nsOutlookStringBundle::FreeString(pFmt);
ImportOutlookMailImpl::AddLinebreak(pStream);
}
--- a/mailnews/import/outlook/src/nsOutlookMail.cpp
+++ b/mailnews/import/outlook/src/nsOutlookMail.cpp
@@ -198,17 +198,17 @@ bool nsOutlookMail::IsAddressBookNameUni
void nsOutlookMail::MakeAddressBookNameUnique(nsString& name, nsString& list)
{
nsString newName;
int idx = 1;
newName = name;
while (!IsAddressBookNameUnique(newName, list)) {
newName = name;
- newName.Append(PRUnichar(' '));
+ newName.Append(char16_t(' '));
newName.AppendInt((int32_t) idx);
idx++;
}
name = newName;
list.AppendLiteral("[");
list.Append(name);
list.AppendLiteral("],");
@@ -335,17 +335,17 @@ void nsOutlookMail::OpenMessageStore(CMa
// - Save the composed message to the TB mailbox
// - Ensure the proper cleanup
//
// CMapiMessage
// - Encapsulate the MAPI message interface
// - Gather the information required to (re)compose the message
nsresult nsOutlookMail::ImportMailbox(uint32_t *pDoneSoFar, bool *pAbort,
- int32_t index, const PRUnichar *pName,
+ int32_t index, const char16_t *pName,
nsIMsgFolder *dstFolder,
int32_t *pMsgCount)
{
if ((index < 0) || (index >= m_folderList.GetSize())) {
IMPORT_LOG0("*** Bad mailbox identifier, unable to import\n");
*pAbort = true;
return NS_ERROR_FAILURE;
}
@@ -472,17 +472,17 @@ nsresult nsOutlookMail::ImportMessage(LP
BOOL nsOutlookMail::WriteData(nsIOutputStream *pDest, const char *pData, int32_t len)
{
uint32_t written;
nsresult rv = pDest->Write(pData, len, &written);
return NS_SUCCEEDED(rv) && written == len;
}
-nsresult nsOutlookMail::ImportAddresses(uint32_t *pCount, uint32_t *pTotal, const PRUnichar *pName, uint32_t id, nsIAddrDatabase *pDb, nsString& errors)
+nsresult nsOutlookMail::ImportAddresses(uint32_t *pCount, uint32_t *pTotal, const char16_t *pName, uint32_t id, nsIAddrDatabase *pDb, nsString& errors)
{
if (id >= (uint32_t)(m_addressList.GetSize())) {
IMPORT_LOG0("*** Bad address identifier, unable to import\n");
return NS_ERROR_FAILURE;
}
uint32_t dummyCount = 0;
if (pCount)
@@ -588,17 +588,17 @@ nsresult nsOutlookMail::ImportAddresses(
lpMsg->Release();
}
}
rv = pDb->Commit(nsAddrDBCommitType::kLargeCommit);
return rv;
}
-nsresult nsOutlookMail::CreateList(const PRUnichar * pName,
+nsresult nsOutlookMail::CreateList(const char16_t * pName,
nsIAddrDatabase *pDb,
LPMAPIPROP pUserList,
nsIImportFieldMap *pFieldMap)
{
// If no name provided then we're done.
if (!pName || !(*pName))
return NS_OK;
@@ -722,17 +722,17 @@ void nsOutlookMail::SplitString(nsString
idx= val1.RFindChar(10);
if (idx != -1) {
val2 = Substring(val1, idx + cnt);
val1.SetLength(idx);
SanitizeValue(val1);
}
}
-bool nsOutlookMail::BuildCard(const PRUnichar *pName, nsIAddrDatabase *pDb, nsIMdbRow *newRow, LPMAPIPROP pUser, nsIImportFieldMap *pFieldMap)
+bool nsOutlookMail::BuildCard(const char16_t *pName, nsIAddrDatabase *pDb, nsIMdbRow *newRow, LPMAPIPROP pUser, nsIImportFieldMap *pFieldMap)
{
nsString lastName;
nsString firstName;
nsString eMail;
nsString nickName;
nsString middleName;
nsString secondEMail;
@@ -791,21 +791,21 @@ bool nsOutlookMail::BuildCard(const PRUn
SanitizeValue(displayName);
}
if (displayName.IsEmpty()) {
if (firstName.IsEmpty())
displayName = pName;
else {
displayName = firstName;
if (!middleName.IsEmpty()) {
- displayName.Append(PRUnichar(' '));
+ displayName.Append(char16_t(' '));
displayName.Append(middleName);
}
if (!lastName.IsEmpty()) {
- displayName.Append(PRUnichar(' '));
+ displayName.Append(char16_t(' '));
displayName.Append(lastName);
}
}
}
// We now have the required fields
// write them out followed by any optional fields!
if (!displayName.IsEmpty()) {
--- a/mailnews/import/outlook/src/nsOutlookMail.h
+++ b/mailnews/import/outlook/src/nsOutlookMail.h
@@ -20,30 +20,30 @@ class nsIImportFieldMap;
class nsOutlookMail {
public:
nsOutlookMail();
~nsOutlookMail();
nsresult GetMailFolders(nsIArray **pArray);
nsresult GetAddressBooks(nsIArray **pArray);
nsresult ImportMailbox(uint32_t *pDoneSoFar, bool *pAbort, int32_t index,
- const PRUnichar *pName, nsIMsgFolder *pDest,
+ const char16_t *pName, nsIMsgFolder *pDest,
int32_t *pMsgCount);
static nsresult ImportMessage(LPMESSAGE lpMsg, nsIOutputStream *destOutputStream, nsMsgDeliverMode mode);
- nsresult ImportAddresses(uint32_t *pCount, uint32_t *pTotal, const PRUnichar *pName, uint32_t id, nsIAddrDatabase *pDb, nsString& errors);
+ nsresult ImportAddresses(uint32_t *pCount, uint32_t *pTotal, const char16_t *pName, uint32_t id, nsIAddrDatabase *pDb, nsString& errors);
private:
void OpenMessageStore(CMapiFolder *pNextFolder);
static BOOL WriteData(nsIOutputStream *pDest, const char *pData, int32_t len);
bool IsAddressBookNameUnique(nsString& name, nsString& list);
void MakeAddressBookNameUnique(nsString& name, nsString& list);
void SanitizeValue(nsString& val);
void SplitString(nsString& val1, nsString& val2);
- bool BuildCard(const PRUnichar *pName, nsIAddrDatabase *pDb, nsIMdbRow *newRow, LPMAPIPROP pUser, nsIImportFieldMap *pFieldMap);
- nsresult CreateList(const PRUnichar * pName, nsIAddrDatabase *pDb, LPMAPIPROP pUserList, nsIImportFieldMap *pFieldMap);
+ bool BuildCard(const char16_t *pName, nsIAddrDatabase *pDb, nsIMdbRow *newRow, LPMAPIPROP pUser, nsIImportFieldMap *pFieldMap);
+ nsresult CreateList(const char16_t * pName, nsIAddrDatabase *pDb, LPMAPIPROP pUserList, nsIImportFieldMap *pFieldMap);
private:
bool m_gotFolders;
bool m_gotAddresses;
bool m_haveMapi;
CMapiApi m_mapi;
CMapiFolderList m_folderList;
CMapiFolderList m_addressList;
--- a/mailnews/import/outlook/src/nsOutlookSettings.cpp
+++ b/mailnews/import/outlook/src/nsOutlookSettings.cpp
@@ -97,17 +97,17 @@ nsOutlookSettings::nsOutlookSettings()
}
nsOutlookSettings::~nsOutlookSettings()
{
}
NS_IMPL_ISUPPORTS1(nsOutlookSettings, nsIImportSettings)
-NS_IMETHODIMP nsOutlookSettings::AutoLocate(PRUnichar **description, nsIFile **location, bool *_retval)
+NS_IMETHODIMP nsOutlookSettings::AutoLocate(char16_t **description, nsIFile **location, bool *_retval)
{
NS_PRECONDITION(description != nullptr, "null ptr");
NS_PRECONDITION(_retval != nullptr, "null ptr");
if (!description || !_retval)
return NS_ERROR_NULL_POINTER;
*description = nsOutlookStringBundle::GetStringByID(OUTLOOKIMPORT_NAME);
*_retval = false;
--- a/mailnews/import/outlook/src/nsOutlookStringBundle.cpp
+++ b/mailnews/import/outlook/src/nsOutlookStringBundle.cpp
@@ -32,28 +32,28 @@ nsIStringBundle *nsOutlookStringBundle::
m_pBundle = sBundle;
return sBundle;
}
void nsOutlookStringBundle::GetStringByID(int32_t stringID, nsString& result)
{
- PRUnichar *ptrv = GetStringByID(stringID);
+ char16_t *ptrv = GetStringByID(stringID);
result = ptrv;
FreeString(ptrv);
}
-PRUnichar *nsOutlookStringBundle::GetStringByID(int32_t stringID)
+char16_t *nsOutlookStringBundle::GetStringByID(int32_t stringID)
{
if (m_pBundle)
m_pBundle = GetStringBundle();
if (m_pBundle) {
- PRUnichar *ptrv = nullptr;
+ char16_t *ptrv = nullptr;
nsresult rv = m_pBundle->GetStringFromID(stringID, &ptrv);
if (NS_SUCCEEDED(rv) && ptrv)
return ptrv;
}
nsString resultString;
resultString.AppendLiteral("[StringID ");
--- a/mailnews/import/outlook/src/nsOutlookStringBundle.h
+++ b/mailnews/import/outlook/src/nsOutlookStringBundle.h
@@ -7,20 +7,20 @@
#include "nsCRTGlue.h"
#include "nsStringGlue.h"
class nsIStringBundle;
class nsOutlookStringBundle {
public:
- static PRUnichar * GetStringByID(int32_t stringID);
+ static char16_t * GetStringByID(int32_t stringID);
static void GetStringByID(int32_t stringID, nsString& result);
static nsIStringBundle * GetStringBundle(void); // don't release
- static void FreeString(PRUnichar *pStr) { NS_Free(pStr);}
+ static void FreeString(char16_t *pStr) { NS_Free(pStr);}
static void Cleanup(void);
private:
static nsIStringBundle * m_pBundle;
};
#define OUTLOOKIMPORT_NAME 2000
--- a/mailnews/import/src/nsImportAddressBooks.cpp
+++ b/mailnews/import/src/nsImportAddressBooks.cpp
@@ -63,27 +63,27 @@ public:
private:
void GetDefaultLocation(void);
void GetDefaultBooks(void);
void GetDefaultFieldMap(void);
public:
static void SetLogs(nsString& success, nsString& error, nsISupportsString *pSuccess, nsISupportsString *pError);
- static void ReportError(const PRUnichar *pName, nsString *pStream,
+ static void ReportError(const char16_t *pName, nsString *pStream,
nsIStringBundle *aBundle);
private:
nsIImportAddressBooks * m_pInterface;
nsCOMPtr<nsIArray> m_Books;
nsCOMArray<nsIAddrDatabase> m_DBs;
nsCOMPtr <nsIFile> m_pLocation;
nsIImportFieldMap * m_pFieldMap;
bool m_autoFind;
- PRUnichar * m_description;
+ char16_t * m_description;
bool m_gotLocation;
bool m_found;
bool m_userVerify;
nsISupportsString * m_pSuccessLog;
nsISupportsString * m_pErrorLog;
uint32_t m_totalSize;
bool m_doImport;
AddressThreadData * m_pThreadData;
@@ -237,17 +237,17 @@ NS_IMETHODIMP nsImportGenericAddressBook
rNum += (*pNum - '0');
pNum++;
}
IMPORT_LOG1("Requesting sample data #: %ld\n", (long)rNum);
if (m_pInterface) {
nsCOMPtr<nsISupportsString> data = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
if (NS_FAILED(rv))
return rv;
- PRUnichar * pData = nullptr;
+ char16_t * pData = nullptr;
bool found = false;
rv = m_pInterface->GetSampleData(rNum, &found, &pData);
if (NS_FAILED(rv))
return rv;
if (found) {
data->SetData(nsDependentString(pData));
*_retval = data;
NS_ADDREF(*_retval);
@@ -501,17 +501,17 @@ already_AddRefed<nsIAddrDatabase> GetAdd
if (!mdbDirectory)
return nullptr;
nsCOMPtr<nsIAddrDatabase> pDatabase;
mdbDirectory->GetDatabase(getter_AddRefs(pDatabase));
return pDatabase.forget();
}
-already_AddRefed<nsIAddrDatabase> GetAddressBook(const PRUnichar *name,
+already_AddRefed<nsIAddrDatabase> GetAddressBook(const char16_t *name,
bool makeNew)
{
if (!makeNew) {
// FIXME: How do I get the list of address books and look for a
// specific name. Major bogosity!
// For now, assume we didn't find anything with that name
}
@@ -775,25 +775,25 @@ AddressThreadData::~AddressThreadData()
NS_IF_RELEASE(books);
NS_IF_RELEASE(addressImport);
NS_IF_RELEASE(errorLog);
NS_IF_RELEASE(successLog);
NS_IF_RELEASE(fieldMap);
NS_IF_RELEASE(stringBundle);
}
-void nsImportGenericAddressBooks::ReportError(const PRUnichar *pName,
+void nsImportGenericAddressBooks::ReportError(const char16_t *pName,
nsString *pStream,
nsIStringBundle* aBundle)
{
if (!pStream)
return;
// load the error string
- PRUnichar *pFmt = nsImportStringBundle::GetStringByID(IMPORT_ERROR_GETABOOK, aBundle);
- PRUnichar *pText = nsTextFormatter::smprintf(pFmt, pName);
+ char16_t *pFmt = nsImportStringBundle::GetStringByID(IMPORT_ERROR_GETABOOK, aBundle);
+ char16_t *pText = nsTextFormatter::smprintf(pFmt, pName);
pStream->Append(pText);
nsTextFormatter::smprintf_free(pText);
NS_Free(pFmt);
pStream->AppendLiteral(MSG_LINEBREAK);
}
static void ImportAddressThread(void *stuff)
{
@@ -825,18 +825,18 @@ static void ImportAddressThread(void *st
nsString name;
book->GetPreferredName(name);
nsCOMPtr<nsIAddrDatabase> db = pData->dBs->ObjectAt(i);
bool fatalError = false;
pData->currentSize = size;
if (db) {
- PRUnichar *pSuccess = nullptr;
- PRUnichar *pError = nullptr;
+ char16_t *pSuccess = nullptr;
+ char16_t *pError = nullptr;
/*
if (pData->fieldMap) {
int32_t sz = 0;
int32_t mapIndex;
bool active;
pData->fieldMap->GetMapSize(&sz);
IMPORT_LOG1("**** Field Map Size: %d\n", (int) sz);
--- a/mailnews/import/src/nsImportFieldMap.cpp
+++ b/mailnews/import/src/nsImportFieldMap.cpp
@@ -88,17 +88,17 @@ NS_IMETHODIMP nsImportFieldMap::GetMapSi
NS_PRECONDITION(aNumFields != nullptr, "null ptr");
if (!aNumFields)
return NS_ERROR_NULL_POINTER;
*aNumFields = m_numFields;
return NS_OK;
}
-NS_IMETHODIMP nsImportFieldMap::GetFieldDescription(int32_t index, PRUnichar **_retval)
+NS_IMETHODIMP nsImportFieldMap::GetFieldDescription(int32_t index, char16_t **_retval)
{
NS_PRECONDITION(_retval != nullptr, "null ptr");
if (!_retval)
return NS_ERROR_NULL_POINTER;
*_retval = nullptr;