diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-21 15:24:13 +0000 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-01-26 23:20:56 +0100 |
commit | 732f8662365035226677921e98a327bad8620e58 (patch) | |
tree | 542fd17d3c4d03f80f07c0e1d9a4947341528487 /svl | |
parent | 0d55bd08f77c01fa6e34becc1505268dda7851b8 (diff) |
ofz#5535 max decimal places for rtl_math_round is 20
Change-Id: I636e086c51ceb70bdac72acfbabe99ad29003cdb
Reviewed-on: https://gerrit.libreoffice.org/48268
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/48299
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index d29ecddb1d16..3687ebc4756b 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -39,6 +39,8 @@ using namespace svt; const sal_Unicode cNoBreakSpace = 0xA0; const sal_Unicode cNarrowNoBreakSpace = 0x202F; +const int MaxCntPost = 20; //max dec places allow by rtl_math_round + const ::std::vector<OUString> ImpSvNumberformatScan::sEnglishKeyword = { // Syntax keywords in English (USA) //! All keywords MUST be UPPERCASE! In same order as NfKeywordTable @@ -2735,7 +2737,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) switch( sStrArray[i][0] ) { case '0': - if ( bTimePart && Is100SecZero( i, bDecSep ) ) + if (bTimePart && Is100SecZero(i, bDecSep) && nCounter < MaxCntPost) { bDecSep = true; nTypeArray[i] = NF_SYMBOLTYPE_DIGIT; @@ -2743,7 +2745,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nCounter++; i++; while (i < nStringsCnt && - sStrArray[i][0] == '0') + sStrArray[i][0] == '0' && nCounter < MaxCntPost) { rStr += sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; |