summaryrefslogtreecommitdiffstats
path: root/svl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-02-24 08:07:12 +0100
committerAndras Timar <andras.timar@collabora.com>2020-02-24 13:32:45 +0100
commitf07e77b93ddfbac967dbc526dc01ec39b5a046c7 (patch)
tree226cb1bad579ae9eb0f2851ccb8c09ea36349172 /svl
parenttdf#130768 speedup huge pixel graphics Cairo (diff)
downloadcore-f07e77b93ddfbac967dbc526dc01ec39b5a046c7.tar.gz
core-f07e77b93ddfbac967dbc526dc01ec39b5a046c7.zip
Fix currency symbol selection in Calc on mobile
In LOK we use one language identifier for both - UI language and the locale used. This is a problem when we determine that we a language for UI is not available and fall-back to the default "en-US" langauge, which also changes the locale. This introduces a separate variable that stores the language tag for the locale independently to the language. Another problem is that in some cases we don't reset the staticly initialized data, when the new document is loaded, which is on the other hand used to define which currency symbol is used as SYSTEM locale. That can in some cases select the wrong currency symbol even when we changed the locale to something else. This fix introduces a reset function, which is triggered on every document load. Change-Id: I55c7f467600a832895f94346f8bf11a6ef6a1e49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89320 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 68e9ef12e1ba..15a24f0d3b13 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3334,6 +3334,16 @@ sal_uInt16 SvNumberFormatter::GetYear2000Default()
return 1930;
}
+// static
+void SvNumberFormatter::resetTheCurrencyTable()
+{
+ SAL_INFO("svl", "Resetting the currency table.");
+
+ nSystemCurrencyPosition = 0;
+ bCurrencyTableInitialized = false;
+
+ GetFormatterRegistry().ConfigurationChanged(nullptr, ConfigurationHints::Locale | ConfigurationHints::Currency | ConfigurationHints::DatePatterns);
+}
// static
const NfCurrencyTable& SvNumberFormatter::GetTheCurrencyTable()