mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Branch merge for bug 441169, bug 22310, bug 430219, bug 443095, bug 443096, bug 441703, and bug 441360.
This commit is contained in:
commit
c7efe0896a
@ -46,6 +46,7 @@
|
||||
#include "nsIScriptableDateFormat.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIPrefService.h"
|
||||
|
||||
static NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID);
|
||||
static NS_DEFINE_CID(kDateTimeFormatCID, NS_DATETIMEFORMAT_CID);
|
||||
@ -114,14 +115,19 @@ NS_IMETHODIMP nsScriptableDateFormat::FormatDateTime(
|
||||
|
||||
nsCOMPtr<nsILocale> locale;
|
||||
// re-initialise locale pointer only if the locale was given explicitly
|
||||
if (!localeName.IsEmpty()) {
|
||||
// get locale service
|
||||
nsCOMPtr<nsILocaleService> localeService(do_GetService(kLocaleServiceCID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// get locale
|
||||
rv = localeService->NewLocale(localeName, getter_AddRefs(locale));
|
||||
if (localeName.IsEmpty()) {
|
||||
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCString cLocaleName;
|
||||
rv = prefs->GetCharPref("general.useragent.locale", getter_Copies(cLocaleName));
|
||||
CopyUTF8toUTF16(cLocaleName, localeName);
|
||||
}
|
||||
// get locale service
|
||||
nsCOMPtr<nsILocaleService> localeService(do_GetService(kLocaleServiceCID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// get locale
|
||||
rv = localeService->NewLocale(localeName, getter_AddRefs(locale));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDateTimeFormat> dateTimeFormat(do_CreateInstance(kDateTimeFormatCID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -377,8 +377,6 @@ private:
|
||||
nsresult GetPopupLinkNode(nsIDOMNode** aNode);
|
||||
nsresult GetPopupImageNode(nsIImageLoadingContent** aNode);
|
||||
|
||||
void DumpContentToPPM(const char* aFileName);
|
||||
|
||||
void PrepareToStartLoad(void);
|
||||
|
||||
nsresult SyncParentSubDocMap();
|
||||
|
Loading…
x
Reference in New Issue
Block a user