summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-10-27 15:28:52 +0200
committerEike Rathke <erack@redhat.com>2017-10-27 18:29:44 +0200
commit0ce0999fa2ace834558f9e79053df60b60623950 (patch)
tree52d8a3b61468a9a7ebf852e2c21a4dc693c5367f
parentca214981553eb21a4276d07c76db0c37c234a11c (diff)
Check decimalSeparatorAlternative in GetDefaultFormulaSeparators(), tdf#81671
Change-Id: Idf413d1e9db4f63bd90888f1dfc6a5d9455e47cb
-rw-r--r--sc/source/core/tool/formulaopt.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 2271d8801164..5fba1d82661b 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -88,13 +88,19 @@ void ScFormulaOptions::GetDefaultFormulaSeparators(
sal_Unicode cDecSep = rDecSep[0];
sal_Unicode cListSep = rListSep[0];
+ sal_Unicode cDecSepAlt = rLocaleData.getNumDecimalSepAlt().toChar(); // usually 0 (empty)
// Excel by default uses system's list separator as the parameter
// separator, which in English locales is a comma. However, OOo's list
// separator value is set to ';' for all English locales. Because of this
// discrepancy, we will hardcode the separator value here, for now.
- if (cDecSep == '.')
+ // Similar for decimal separator alternative.
+ // However, if the decimal separator alternative is '.' and the decimal
+ // separator is ',' this makes no sense, fall back to ';' in that case.
+ if (cDecSep == '.' || (cDecSepAlt == '.' && cDecSep != ','))
cListSep = ',';
+ else if (cDecSep == ',' && cDecSepAlt == '.')
+ cListSep = ';';
// Special case for de_CH locale.
if (rLocale.Language == "de" && rLocale.Country == "CH")