diff --git a/mailnews/base/search/src/nsMsgFilter.cpp b/mailnews/base/search/src/nsMsgFilter.cpp index f9e0b26723..377b215fb0 100644 --- a/mailnews/base/search/src/nsMsgFilter.cpp +++ b/mailnews/base/search/src/nsMsgFilter.cpp @@ -531,8 +531,8 @@ nsMsgFilter::LogRuleHitGeneric(nsIMsgRuleAction *aFilterAction, PRExplodedTime exploded; PR_ExplodeTime(date, PR_LocalTimeParameters, &exploded); - mozilla::DateTimeFormat::FormatPRExplodedTime(kDateFormatShort, - kTimeFormatSeconds, + mozilla::DateTimeFormat::FormatPRExplodedTime(mozilla::kDateFormatShort, + mozilla::kTimeFormatSeconds, &exploded, dateValue); @@ -646,8 +646,8 @@ nsMsgFilter::LogRuleHitGeneric(nsIMsgRuleAction *aFilterAction, // Prepare timestamp PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &exploded); - mozilla::DateTimeFormat::FormatPRExplodedTime(kDateFormatShort, - kTimeFormatSeconds, + mozilla::DateTimeFormat::FormatPRExplodedTime(mozilla::kDateFormatShort, + mozilla::kTimeFormatSeconds, &exploded, dateValue); diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp index e9d13a93d2..bbed80a520 100644 --- a/mailnews/base/src/nsMsgDBView.cpp +++ b/mailnews/base/src/nsMsgDBView.cpp @@ -68,9 +68,9 @@ 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; +mozilla::nsDateFormatSelector nsMsgDBView::m_dateFormatDefault = mozilla::kDateFormatShort; +mozilla::nsDateFormatSelector nsMsgDBView::m_dateFormatThisWeek = mozilla::kDateFormatShort; +mozilla::nsDateFormatSelector nsMsgDBView::m_dateFormatToday = mozilla::kDateFormatNone; static const uint32_t kMaxNumSortColumns = 2; @@ -587,7 +587,7 @@ nsresult nsMsgDBView::FetchDate(nsIMsgDBHdr * aHdr, nsAString &aDateString, bool // if the message is from the last week, show the day of the week. (i.e. Mon 3:15 pm) // in all other cases, show the full date (03/19/01 3:15 pm) - nsDateFormatSelector dateFormat = m_dateFormatDefault; + mozilla::nsDateFormatSelector dateFormat = m_dateFormatDefault; if (explodedCurrentTime.tm_year == explodedMsgTime.tm_year && explodedCurrentTime.tm_month == explodedMsgTime.tm_month && explodedCurrentTime.tm_mday == explodedMsgTime.tm_mday) @@ -623,7 +623,7 @@ nsresult nsMsgDBView::FetchDate(nsIMsgDBHdr * aHdr, nsAString &aDateString, bool if (NS_SUCCEEDED(rv)) rv = mozilla::DateTimeFormat::FormatPRTime(dateFormat, - kTimeFormatNoSeconds, + mozilla::kTimeFormatNoSeconds, dateOfMsg, aDateString); @@ -7888,7 +7888,8 @@ nsMsgDBView::FindIndexOfMsgHdr(nsIMsgDBHdr *aMsgHdr, bool aExpand, nsMsgViewInde return NS_OK; } -static void getDateFormatPref( nsIPrefBranch* _prefBranch, const char* _prefLocalName, nsDateFormatSelector& _format ) +static void +getDateFormatPref( nsIPrefBranch* _prefBranch, const char* _prefLocalName, mozilla::nsDateFormatSelector& _format ) { // read int32_t nFormatSetting( 0 ); @@ -7896,18 +7897,19 @@ static void getDateFormatPref( nsIPrefBranch* _prefBranch, const char* _prefLoca if ( NS_SUCCEEDED( result ) ) { // translate - nsDateFormatSelector res( nFormatSetting ); + mozilla::nsDateFormatSelector res; + res = static_cast(nFormatSetting); // transfer if valid - if ( ( res >= kDateFormatNone ) && ( res <= kDateFormatWeekday ) ) + if ( ( res >= mozilla::kDateFormatNone ) && ( res <= mozilla::kDateFormatWeekday ) ) _format = res; } } nsresult nsMsgDBView::InitDisplayFormats() { - m_dateFormatDefault = kDateFormatShort; - m_dateFormatThisWeek = kDateFormatShort; - m_dateFormatToday = kDateFormatNone; + m_dateFormatDefault = mozilla::kDateFormatShort; + m_dateFormatThisWeek = mozilla::kDateFormatShort; + m_dateFormatToday = mozilla::kDateFormatNone; nsresult rv = NS_OK; nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); diff --git a/mailnews/base/src/nsMsgDBView.h b/mailnews/base/src/nsMsgDBView.h index 25388c206d..f9de13c645 100644 --- a/mailnews/base/src/nsMsgDBView.h +++ b/mailnews/base/src/nsMsgDBView.h @@ -478,9 +478,9 @@ protected: static nsresult InitDisplayFormats(); private: - static nsDateFormatSelector m_dateFormatDefault; - static nsDateFormatSelector m_dateFormatThisWeek; - static nsDateFormatSelector m_dateFormatToday; + static mozilla::nsDateFormatSelector m_dateFormatDefault; + static mozilla::nsDateFormatSelector m_dateFormatThisWeek; + static mozilla::nsDateFormatSelector m_dateFormatToday; bool ServerSupportsFilterAfterTheFact(); nsresult PerformActionsOnJunkMsgs(bool msgsAreJunk); diff --git a/mailnews/base/src/nsSpamSettings.cpp b/mailnews/base/src/nsSpamSettings.cpp index 7e47f37e35..081a0ac3e7 100644 --- a/mailnews/base/src/nsSpamSettings.cpp +++ b/mailnews/base/src/nsSpamSettings.cpp @@ -649,8 +649,8 @@ NS_IMETHODIMP nsSpamSettings::LogJunkHit(nsIMsgDBHdr *aMsgHdr, bool aMoveMessage PRExplodedTime exploded; PR_ExplodeTime(date, PR_LocalTimeParameters, &exploded); - mozilla::DateTimeFormat::FormatPRExplodedTime(kDateFormatShort, - kTimeFormatSeconds, + mozilla::DateTimeFormat::FormatPRExplodedTime(mozilla::kDateFormatShort, + mozilla::kTimeFormatSeconds, &exploded, dateValue); @@ -721,8 +721,8 @@ NS_IMETHODIMP nsSpamSettings::LogJunkString(const char *string) PRExplodedTime exploded; PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &exploded); - mozilla::DateTimeFormat::FormatPRExplodedTime(kDateFormatShort, - kTimeFormatSeconds, + mozilla::DateTimeFormat::FormatPRExplodedTime(mozilla::kDateFormatShort, + mozilla::kTimeFormatSeconds, &exploded, dateValue); diff --git a/mailnews/base/util/StringBundle.js b/mailnews/base/util/StringBundle.js index a1e10ec62c..78430cbc3f 100644 --- a/mailnews/base/util/StringBundle.js +++ b/mailnews/base/util/StringBundle.js @@ -35,27 +35,13 @@ function StringBundle(url) { } StringBundle.prototype = { - /** - * the locale associated with the application - * @type nsILocale - * @private - */ - get _appLocale() { - try { - return Services.locale.getApplicationLocale(); - } - catch(ex) { - return null; - } - }, - /** * the wrapped nsIStringBundle * @type nsIStringBundle * @private */ get _stringBundle() { - let stringBundle = Services.strings.createBundle(this.url, this._appLocale); + let stringBundle = Services.strings.createBundle(this.url); this.__defineGetter__("_stringBundle", () => stringBundle); return this._stringBundle; }, @@ -134,16 +120,6 @@ StringBundle.prototype = { this.url = newVal; }, - /** - * the locale associated with the application - * @deprecated because it has never been used outside the XBL binding itself, - * and consumers should obtain it directly from the locale service anyway. - * @type nsILocale - */ - get appLocale() { - return this._appLocale; - }, - /** * the wrapped nsIStringBundle * @deprecated because this module should provide all necessary functionality diff --git a/mailnews/mime/emitters/nsMimeBaseEmitter.cpp b/mailnews/mime/emitters/nsMimeBaseEmitter.cpp index e79434007d..dd96103354 100644 --- a/mailnews/mime/emitters/nsMimeBaseEmitter.cpp +++ b/mailnews/mime/emitters/nsMimeBaseEmitter.cpp @@ -709,20 +709,20 @@ nsMimeBaseEmitter::GenerateDateString(const char * dateString, // If we want short dates, check if the message is from today, and if so // only show the time (e.g. 3:15 pm). - nsDateFormatSelector dateFormat = kDateFormatShort; + mozilla::nsDateFormatSelector dateFormat = mozilla::kDateFormatShort; if (!showDateForToday && explodedCurrentTime.tm_year == explodedCompTime.tm_year && explodedCurrentTime.tm_month == explodedCompTime.tm_month && explodedCurrentTime.tm_mday == explodedCompTime.tm_mday) { // same day... - dateFormat = kDateFormatNone; + dateFormat = mozilla::kDateFormatNone; } nsAutoString formattedDateString; rv = mozilla::DateTimeFormat::FormatPRExplodedTime(dateFormat, - kTimeFormatNoSeconds, + mozilla::kTimeFormatNoSeconds, &explodedCompTime, formattedDateString);