void-packages/srcpkgs/chromium/patches/chromium-fix-print-preview-...

15 lines
805 B
Diff
Raw Normal View History

--- chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ 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