Branch merge for bug 441169, bug 22310, bug 430219, bug 443095, bug 443096, bug 441703, and bug 441360.

This commit is contained in:
Reed Loden 2008-07-12 05:33:29 -05:00
commit c7efe0896a
2 changed files with 12 additions and 8 deletions

View File

@ -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);

View File

@ -377,8 +377,6 @@ private:
nsresult GetPopupLinkNode(nsIDOMNode** aNode);
nsresult GetPopupImageNode(nsIImageLoadingContent** aNode);
void DumpContentToPPM(const char* aFileName);
void PrepareToStartLoad(void);
nsresult SyncParentSubDocMap();