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

Laurent BP laurent.balland-poirier at laposte.net
Tue Jun 19 22:40:13 UTC 2018


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

New commits:
commit 062e0999c2b7923e463f1611204a63f0bb7b6404
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>

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index fd482cc27f2e..53e7a02e9acf 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -4487,13 +4487,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