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

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Fri Aug 5 00:06:55 UTC 2016


 svl/source/numbers/zforscan.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 21639ac7f5b075808925186cdd5a102eb8d7a02a
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Wed Aug 3 11:56:16 2016 +0200

    tdf#101147 New approach to fix minute/month detection
    
    Other formats may be differently interpreted
    HH YY/MM => Month expected
    HH DD/MM => Month expected
    
    Change-Id: Iabb17911bf2907c02b6b898052b6933692f8074a
    Reviewed-on: https://gerrit.libreoffice.org/27887
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 608d0f3..1552d81 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1162,6 +1162,8 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
                    That are the Excel rules. BUT, we break it because certainly
                    in something like {HH YYYY-MM-DD} the MM is NOT meant to be
                    minute, so not if MM is between YY and DD or DD and YY.
+                   Actually not if any date specific keyword followed a time
+                   setting keyword.
                 */
                 nIndexPre = PreviousKeyword(i);
                 nIndexNex = NextKeyword(i);
@@ -1169,12 +1171,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
                     nIndexPre == NF_KEY_HH  ||      // HH
                     nIndexNex == NF_KEY_S   ||      // S
                     nIndexNex == NF_KEY_SS  ||      // SS
-                    (bIsTimeDetected &&
-                     !(((nIndexPre == NF_KEY_YY || nIndexPre == NF_KEY_YYYY) &&
-                        (nIndexNex == NF_KEY_D  || nIndexNex == NF_KEY_DD)) ||
-                       ((nIndexPre == NF_KEY_D  || nIndexPre == NF_KEY_DD) &&
-                        (nIndexNex == NF_KEY_YY || nIndexNex == NF_KEY_YYYY)))
-                    )                       ||      // tdf#101147
+                    bIsTimeDetected         ||      // tdf#101147
                     PreviousChar(i) == '['  )       // [M
                 {
                     eNewType = css::util::NumberFormat::TIME;
@@ -1212,6 +1209,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
             case NF_KEY_R :                         // R
             case NF_KEY_RR :                        // RR
                 eNewType = css::util::NumberFormat::DATE;
+                bIsTimeDetected = false;
                 break;
             case NF_KEY_CCC:                        // CCC
                 eNewType = css::util::NumberFormat::CURRENCY;


More information about the Libreoffice-commits mailing list