Branch merge for bug 441169, bug 22310, bug 430219, bug 443095, bug 443096, bug 441703, and bug 441360.
authorReed Loden <reed@reedloden.com>
Sat, 12 Jul 2008 05:33:29 -0500
changeset 15874 2ac26a81778237cd1ce0ea4630b139692c5880b4
parent 15873 b9344d23a2fc181ce5eff0108c114bafbca97a5f (current diff)
parent 15867 d9c4a4d5a4e481cb06395ec6b47b27e3e0df4c49 (diff)
child 15875 3050d9df608aa192a8ecd17d2c6136a0b97f7656
push id564
push userreed@reedloden.com
push dateSat, 12 Jul 2008 10:33:13 +0000
treeherderautoland@2ac26a817782 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs441169, 22310, 430219, 443095, 443096, 441703, 441360
milestone1.9.1a1pre
Branch merge for bug 441169, bug 22310, bug 430219, bug 443095, bug 443096, bug 441703, and bug 441360.
--- a/intl/locale/src/nsScriptableDateFormat.cpp
+++ b/intl/locale/src/nsScriptableDateFormat.cpp
@@ -41,16 +41,17 @@
 #include "nsIComponentManager.h"
 #include "nsLocaleCID.h"
 #include "nsILocaleService.h"
 #include "nsDateTimeFormatCID.h"
 #include "nsIDateTimeFormat.h"
 #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);
 
 class nsScriptableDateFormat : public nsIScriptableDateFormat {
  public: 
   NS_DECL_ISUPPORTS 
 
@@ -109,24 +110,29 @@ NS_IMETHODIMP nsScriptableDateFormat::Fo
     return NS_ERROR_INVALID_ARG;
 
   nsresult rv;
   nsAutoString localeName(aLocale);
   *dateTimeString = nsnull;
 
   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));
+  if (localeName.IsEmpty()) {
+    nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
-    // get locale
-    rv = localeService->NewLocale(localeName, getter_AddRefs(locale));
-    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);
 
   tm tmTime;
   time_t timetTime;
 
   memset(&tmTime, 0, sizeof(tmTime));
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -372,18 +372,16 @@ private:
    * in the view manager
    */
   nsresult InitPresentationStuff(PRBool aDoInitialReflow, PRBool aReenableRefresh);
 
   nsresult GetPopupNode(nsIDOMNode** aNode);
   nsresult GetPopupLinkNode(nsIDOMNode** aNode);
   nsresult GetPopupImageNode(nsIImageLoadingContent** aNode);
 
-  void DumpContentToPPM(const char* aFileName);
-
   void PrepareToStartLoad(void);
 
   nsresult SyncParentSubDocMap();
 
   nsresult GetDocumentSelection(nsISelection **aSelection);
 
   nsresult GetClipboardEventTarget(nsIDOMNode **aEventTarget);
   nsresult FireClipboardEvent(PRUint32 msg, PRBool* aPreventDefault);