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>
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 74a7652..c8d41ff 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)
@@ -2556,7 +2558,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;
@@ -2564,7 +2566,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 0000000..5439e00
--- /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