summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-07-01 15:46:01 +0200
committerEike Rathke <erack@redhat.com>2021-07-01 17:10:07 +0200
commitd703131d063c41b8baca01830c4c9806f99ab7d2 (patch)
treecccde01534e879c02dffd3e5950c38b26b8aded1 /sc
parentaa7b1f2ec7da5b94459f808e151085f4d301afd1 (diff)
Resolves: tdf#138432 Use locale's CharClass to parse numeric i18n context
Change-Id: I1828f1b6f93228cd517a6a7bd9ae36584bd801a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118226 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 76a60156fd16..0d1dc9d52aa6 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2746,6 +2746,10 @@ Label_MaskStateMachine:
cGroupSep != cArrayColSep && cGroupSep != cArrayRowSep &&
cGroupSep != cDecSep && cGroupSep != cDecSepAlt &&
cGroupSep != cSheetPrefix && cGroupSep != cSheetSep);
+ // If a numeric context triggered bi18n then use the default locale's
+ // CharClass, this may accept group separator as well.
+ const CharClass* pMyCharClass = (ScGlobal::getCharClassPtr()->isDigit( OUString(pStart[nSrcPos]), 0) ?
+ ScGlobal::getCharClassPtr() : pCharClass);
OUStringBuffer aSymbol;
mnRangeOpPosInSymbol = -1;
FormulaError nErr = FormulaError::NONE;
@@ -2756,7 +2760,7 @@ Label_MaskStateMachine:
if ( pStart[nSrcPos] == cSheetPrefix && pStart[nSrcPos+1] == '\'' )
aSymbol.append(pStart[nSrcPos++]);
- ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, pCharClass, bGroupSeparator);
+ ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, pMyCharClass, bGroupSeparator);
if ( !aRes.TokenType )
{