summarylogtreecommitdiffstats
path: root/chromium-fix-print-preview-on-en_GB-locale.patch
blob: 9ebc089cb7564d40fa2ebd1ded2ffb01fd14070f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 6cfd861387c9f8b145fb33472b10025537986213..c936a9c1dadb13c00418e8ae79a8a1987c1d36cd 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -1222,7 +1222,10 @@ void PrintPreviewHandler::GetNumberFormatAndMeasurementSystem(
   UErrorCode errorCode = U_ZERO_ERROR;
   const char* locale = g_browser_process->GetApplicationLocale().c_str();
   UMeasurementSystem system = ulocdata_getMeasurementSystem(locale, &errorCode);
-  if (errorCode > U_ZERO_ERROR || system == UMS_LIMIT)
+  // On error, assume the units are SI.
+  // Since the only measurement units print preview's WebUI cares about are
+  // those for measuring distance, assume anything non-US is SI.
+  if (errorCode > U_ZERO_ERROR || system != UMS_US)
     system = UMS_SI;
 
   // Getting the number formatting based on the locale and writing to