• Mike Kaganski's avatar
    Also use GetLanguageTag() for formatting percents · 3abd8b51
    Mike Kaganski yazdı
    Reading MetricFormatter value (in MetricFormatter::GetValueFromStringUnit)
    uses ImplGetLocaleDataWrapper() to convert the string using current locale
    (including decimal and thousands separator), which calls GetLanguageTag().
    On the other hand, in case of percent value, setting the control text (in
    MetricFormatter::CreateFieldText) uses Application::GetSettings().GetUILanguageTag().
    This gives wrong results e.g. when UI language is different from locale.
    
    For instance, if UI language is English (US), and locale is Russian, then
    increasing from "999 %" would give "1,000 %" (using English (US) locale),
    and then reading back, it would be processed as 1 % (using Russian locale,
    where comma is decimal separator).
    
    This change unifies setting percent text to also use GetLanguageTag().
    
    Change-Id: I9b8a2ee5d3be709a8db3807ea81e105d6475b6a4
    Reviewed-on: https://gerrit.libreoffice.org/52251Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
    Tested-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
    3abd8b51
field.cxx 57.8 KB