diff options
author | Eike Rathke <erack@redhat.com> | 2018-11-30 14:20:49 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-11-30 20:01:20 +0100 |
commit | 776f7e7463de3e97f3056712ee567f49a314829d (patch) | |
tree | f15912a63b4ca1e043434c187726fa2a01c544f6 /i18npool | |
parent | 6408dbf268fc8cc72fa741197e38b07619f0e96a (diff) |
[API CHANGE] Resolves: tdf#42518 new KParseTokens::GROUP_SEPARATOR_IN_NUMBER
Default unset bit now does not accept/skip group separators in
numbers.
See .idl description comment for why this is incompatible and how.
This actually uncovered a "bug" (or at least unexpected) in the
Math parser that parsed "0," as one entity instead of "0" followed
by ",". As obtaining the text form appends a blank after each
entity the sw/qa/extras/rtfexport/rtfexport.cxx testMathEqarray()
testcase had to be adapted.
Change-Id: I2b605742ab3d8a9bb81ad6880faf050535dc80fa
Reviewed-on: https://gerrit.libreoffice.org/64270
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/characterclassification/cclass_unicode_parser.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 8cca988607fd..3c040a5a0085 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -441,8 +441,15 @@ void cclass_Unicode::initParserTable( const Locale& rLocale, sal_Int32 startChar cDecimalSepAlt = aItem.decimalSeparatorAlternative.toChar(); } - if ( cGroupSep < nDefCnt ) - pTable[cGroupSep] |= ParserFlags::VALUE; + if (nContTypes & KParseTokens::GROUP_SEPARATOR_IN_NUMBER) + { + if ( cGroupSep < nDefCnt ) + pTable[cGroupSep] |= ParserFlags::VALUE; + } + else + { + cGroupSep = 0; + } if ( cDecimalSep < nDefCnt ) pTable[cDecimalSep] |= ParserFlags::CHAR_VALUE | ParserFlags::VALUE; if ( cDecimalSepAlt && cDecimalSepAlt < nDefCnt ) @@ -814,6 +821,8 @@ 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))) && ++nDecSeps > 1) { |