summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-10-27 15:12:58 +0200
committerEike Rathke <erack@redhat.com>2017-10-27 18:29:44 +0200
commitc1a47f1a51360f4afed094c1f87790fafb95e103 (patch)
tree85c3ce89fa206e630c1c8077790763c268f6e786
parent21052ba2edeef9e16bf90fea62f007b1131c73c0 (diff)
Handle decimalSeparatorAlternative in ScCompiler, tdf#81671
Change-Id: I7471f0fb237e29a6f4e8bdd3405cd3b831673ca6
-rw-r--r--sc/source/core/tool/compiler.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index cd8760b6bde6..3844e80008e0 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2018,8 +2018,8 @@ sal_Int32 ScCompiler::NextSymbol(bool bInArray)
sal_Unicode cSep = mxSymbols->getSymbolChar( ocSep);
sal_Unicode cArrayColSep = mxSymbols->getSymbolChar( ocArrayColSep);
sal_Unicode cArrayRowSep = mxSymbols->getSymbolChar( ocArrayRowSep);
- sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' :
- ScGlobal::pLocaleData->getNumDecimalSep()[0]);
+ sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' : ScGlobal::pLocaleData->getNumDecimalSep()[0]);
+ sal_Unicode cDecSepAlt = (mxSymbols->isEnglish() ? 0 : ScGlobal::pLocaleData->getNumDecimalSepAlt().toChar());
// special symbols specific to address convention used
sal_Unicode cSheetPrefix = pConv->getSpecialSymbol(ScCompiler::Convention::ABS_SHEET_PREFIX);
@@ -2262,7 +2262,7 @@ Label_MaskStateMachine:
SetError(FormulaError::StringOverflow);
eState = ssStop;
}
- else if (c == cDecSep)
+ else if (c == cDecSep || (cDecSepAlt && c == cDecSepAlt))
{
if (++nDecSeps > 1)
{
@@ -3202,10 +3202,17 @@ bool ScCompiler::IsReference( const OUString& rName, const OUString* pErrRef )
{
// Has to be called before IsValue
sal_Unicode ch1 = rName[0];
- sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' :
- ScGlobal::pLocaleData->getNumDecimalSep()[0] );
+ sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' : ScGlobal::pLocaleData->getNumDecimalSep()[0] );
if ( ch1 == cDecSep )
return false;
+ // Code further down checks only if cDecSep=='.' so simply obtaining the
+ // alternative decimal separator if it's not is sufficient.
+ if (cDecSep != '.')
+ {
+ cDecSep = ScGlobal::pLocaleData->getNumDecimalSepAlt().toChar();
+ if ( ch1 == cDecSep )
+ return false;
+ }
// Who was that imbecile introducing '.' as the sheet name separator!?!
if ( rtl::isAsciiDigit( ch1 ) && pConv->getSpecialSymbol( Convention::SHEET_SEPARATOR) == '.' )
{