diff options
author | Eike Rathke <erack@redhat.com> | 2018-11-30 20:06:24 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-12-01 12:07:24 +0100 |
commit | 673bd16887c354981120f7ebea44b25b0ab2e41e (patch) | |
tree | 3c7d10fe7eee88405bb4d85113c2de41410abe0e /i18npool | |
parent | 5fd429a3e20d0fb91d96be9ded39f81325432509 (diff) |
A leading or trailing group separator character is not a group separator
Also a group separator character followed by a non-digit is not.
Change-Id: Id57e43fe7692706c5532fb05ad394224265c2750
Reviewed-on: https://gerrit.libreoffice.org/64358
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit a4146c38a07ff51b37d40c2e953f54b0a746a8b7)
Reviewed-on: https://gerrit.libreoffice.org/64367
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/characterclassification/cclass_unicode_parser.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 3c040a5a0085..7af1dd8baf45 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -822,8 +822,18 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32 if ( nMask & ParserFlags::VALUE ) { if (current == cGroupSep) - nParseTokensType |= KParseTokens::GROUP_SEPARATOR_IN_NUMBER; - if ((current == cDecimalSep || (bDecSepAltUsed = (cDecimalSepAlt && current == cDecimalSepAlt))) && + { + if (getFlags(nextChar) & ParserFlags::VALUE_DIGIT) + nParseTokensType |= KParseTokens::GROUP_SEPARATOR_IN_NUMBER; + else + { + // Trailing group separator character is not a + // group separator. + eState = ssStopBack; + } + } + else if ((current == cDecimalSep || + (bDecSepAltUsed = (cDecimalSepAlt && current == cDecimalSepAlt))) && ++nDecSeps > 1) { if (nCodePoints == 2) |