diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-21 15:24:13 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-06 14:59:38 +0100 |
commit | d679ac0d39b36ea8173589e32e338869bee58a4c (patch) | |
tree | 1d95dca23f4317231708be014148419951455732 | |
parent | 88c8013c85bcda5cd2f3508ecf6037f0eeba0e69 (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/48303
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 7a59ef66c268674548d13c13b19d52a25445299f)
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 6 | ||||
-rw-r--r-- | sw/qa/core/data/html/pass/ofz5535-1.html | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index db98f7295fd3..7b7f71066f3b 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 + ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP ) : eNewLnge(LANGUAGE_DONTKNOW) , eTmpLnge(LANGUAGE_DONTKNOW) @@ -2493,7 +2495,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; @@ -2501,7 +2503,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nCounter++; i++; while (i < nAnzStrings && - sStrArray[i][0] == '0') + sStrArray[i][0] == '0' && nCounter < MaxCntPost) { rStr += sStrArray[i]; nTypeArray[i] = NF_SYMBOLTYPE_EMPTY; diff --git a/sw/qa/core/data/html/pass/ofz5535-1.html b/sw/qa/core/data/html/pass/ofz5535-1.html new file mode 100644 index 000000000000..5439e009b392 --- /dev/null +++ b/sw/qa/core/data/html/pass/ofz5535-1.html @@ -0,0 +1 @@ +<table><td SDVALSDNUM=;0;MrS)000000000000000000000000000000000000;>
\ No newline at end of file |