[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Oct 28 23:49:21 UTC 2018
vcl/source/window/builder.cxx | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
New commits:
commit 59d48c531a5cad27f02b91c9b86278d5ede211a1
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Oct 28 20:52:37 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Oct 29 00:48:54 2018 +0100
Resolves: tdf#120988 mismatch of in/out locale formatting
Change-Id: I9def43c111adc877aeec9f1990f5dd76fabdbf8f
Reviewed-on: https://gerrit.libreoffice.org/62485
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 360d96e2db82..9e1302041f17 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -217,18 +217,18 @@ namespace weld
{
OUString aStr;
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
+
unsigned int nDecimalDigits = m_xSpinButton->get_digits();
//pawn percent off to icu to decide whether percent is separated from its number for this locale
if (m_eSrcUnit == FUNIT_PERCENT)
{
double fValue = nValue;
fValue /= SpinButton::Power10(nDecimalDigits);
- aStr = unicode::formatPercent(fValue, Application::GetSettings().GetUILanguageTag());
+ aStr = unicode::formatPercent(fValue, rLocaleData.getLanguageTag());
}
else
{
- const SvtSysLocale aSysLocale;
- const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
aStr = rLocaleData.getNum(nValue, nDecimalDigits, true, true);
if (m_eSrcUnit != FUNIT_NONE && m_eSrcUnit != FUNIT_DEGREE)
aStr += " ";
@@ -246,8 +246,7 @@ namespace weld
IMPL_LINK(MetricSpinButton, spin_button_input, int*, result, bool)
{
- const SvtSysLocale aSysLocale;
- const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
double fResult(0.0);
bool bRet = MetricFormatter::TextToValue(get_text(), fResult, 0, m_xSpinButton->get_digits(), rLocaleData, m_eSrcUnit);
if (bRet)
@@ -260,8 +259,7 @@ namespace weld
int nStartPos, nEndPos;
m_xSpinButton->get_selection_bounds(nStartPos, nEndPos);
- const SvtSysLocale aSysLocale;
- const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
const int nTimeArea = TimeFormatter::GetTimeArea(m_eFormat, m_xSpinButton->get_text(), nEndPos,
rLocaleData);
@@ -295,8 +293,7 @@ namespace weld
int nStartPos, nEndPos;
m_xSpinButton->get_selection_bounds(nStartPos, nEndPos);
- const SvtSysLocale aSysLocale;
- const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
tools::Time aResult(0);
bool bRet = TimeFormatter::TextToTime(m_xSpinButton->get_text(), aResult, m_eFormat, true, rLocaleData);
if (bRet)
@@ -328,8 +325,7 @@ namespace weld
OUString TimeSpinButton::format_number(int nValue) const
{
- const SvtSysLocale aSysLocale;
- const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
return TimeFormatter::FormatTime(ConvertValue(nValue), m_eFormat, TimeFormat::Hour24, true, rLocaleData);
}
More information about the Libreoffice-commits
mailing list