[Libreoffice-commits] core.git: svl/source sw/qa

Caolán McNamara caolanm at redhat.com
Sun Jan 21 23:45:57 UTC 2018


 svl/source/numbers/zforscan.cxx          |    6 ++++--
 sw/qa/core/data/html/pass/ofz5535-1.html |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 6763c0ce90825b23a839fac2cd7aede5772c8993
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 21 15:24:13 2018 +0000

    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 at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index e2b121059496..2c70900be729 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 NfKeywordTable ImpSvNumberformatScan::sEnglishKeyword =
 {             // Syntax keywords in English (USA)
     //! All keywords MUST be UPPERCASE! In same order as NfKeywordIndex
@@ -2722,7 +2724,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;
@@ -2730,7 +2732,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;
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


More information about the Libreoffice-commits mailing list