[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - svl/source

Laurent BP laurent.balland-poirier at laposte.net
Wed Jun 20 22:48:12 UTC 2018


 svl/source/numbers/zformat.cxx  |    8 +-------
 svl/source/numbers/zforscan.cxx |    6 +++---
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 57eec349eeb0cf7d0acdeff09daed5867385db4d
Author: Laurent BP <laurent.balland-poirier at laposte.net>
Date:   Fri Jun 15 20:41:18 2018 +0200

    tdf#117575 treat thousand sep with ? in integer part
    
    '?' was missing when treating thousand separator
    However, format with '?' in integer part are not
    saved in ODF.
    
    Change-Id: I1d684a31f800f10bf9a04babb0b9fec34e28e72a
    Reviewed-on: https://gerrit.libreoffice.org/55901
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 062e0999c2b7923e463f1611204a63f0bb7b6404)
    Reviewed-on: https://gerrit.libreoffice.org/56147

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index e24ef037f7ba..a863b984891d 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -4434,13 +4434,7 @@ bool SvNumberformat::ImpNumberFillWithThousands( OUStringBuffer& sBuff,  // numb
                         ;   // nothing
                         break;
                     case '?':
-                        // erAck: 2008-04-03T16:24+0200
-                        // Actually this currently isn't executed
-                        // because the format scanner in the context of
-                        // "?," doesn't generate a group separator but
-                        // a literal ',' character instead that is
-                        // inserted unconditionally. Should be changed
-                        // on some occasion.
+                        // replace thousand separator with blank
                         sBuff.insert(k, ' ');
                         break;
                     default:
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 40b522d074a9..ea9e24236b4c 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -2070,8 +2070,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
                             }
                         }
                         else if (i > 0 && i < nStringsCnt-1   &&
-                                 (cPre == '#' || cPre == '0')      &&
-                                 ((cNext = NextChar(i)) == '#' || cNext == '0')) // #,#
+                                 (cPre == '#' || cPre == '0' || cPre == '?')      &&
+                                 ((cNext = NextChar(i)) == '#' || cNext == '0' || cNext == '?')) // #,#
                         {
                             nPos = nPos + sStrArray[i].getLength();
                             if (!bThousand) // only once
@@ -2083,7 +2083,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
                             nResultStringsCnt--;
                             i++;
                         }
-                        else if (i > 0 && (cPre == '#' || cPre == '0')
+                        else if (i > 0 && (cPre == '#' || cPre == '0' || cPre == '?')
                                  && PreviousType(i) == NF_SYMBOLTYPE_DIGIT
                                  && nThousand < FLAG_STANDARD_IN_FORMAT )
                         {   // #,,,,


More information about the Libreoffice-commits mailing list