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

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 19 19:52:29 UTC 2019


 svl/source/numbers/zforfind.hxx |    4 ++++
 svl/source/numbers/zforlist.cxx |   15 +++++++++++++++
 2 files changed, 19 insertions(+)

New commits:
commit 7dcb5c658987eb52c1bf0b896b0835216f02fac8
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Mon Aug 19 20:03:21 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Mon Aug 19 21:51:49 2019 +0200

    Related: tdf#72040 select ISO 8601 date+time format without 'T' if input
    
    Change-Id: If3f64641f2b42830bb31f6712411d84a1fc2ccc6
    Reviewed-on: https://gerrit.libreoffice.org/77754
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 6e6934304444..cc44b9bcb523 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1168,6 +1168,10 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString,
             {
                 F_Index = GetFormatIndex( NF_DATETIME_ISO_YYYYMMDDTHHMMSS, ActLnge );
             }
+            else if (pStringScanner->CanForceToIso8601( DateOrder::Invalid))
+            {
+                F_Index = GetFormatIndex( NF_DATETIME_ISO_YYYYMMDD_HHMMSS, ActLnge );
+            }
             else
             {
                 F_Index = GetStandardFormat( RType, ActLnge );
commit a231922c4cf41a834bdc252e726912699c5e6f7d
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Mon Aug 19 19:49:02 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Mon Aug 19 21:51:38 2019 +0200

    Related: tdf#72040 select ISO 8601 date+time format if 'T' separator in input
    
    Change-Id: Ia89f791f0a66d0e6d3c3e5ecdd211356f5c2337f
    Reviewed-on: https://gerrit.libreoffice.org/77752
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx
index db19f847c026..1efeb215619b 100644
--- a/svl/source/numbers/zforfind.hxx
+++ b/svl/source/numbers/zforfind.hxx
@@ -68,6 +68,10 @@ public:
 
     void InvalidateDateAcceptancePatterns();
 
+    /** Whether 'T' separator was detected in an ISO 8601 date+time format.
+     */
+    bool HasIso8601Tsep() const { return bIso8601Tsep; }
+
 private:
     SvNumberFormatter*  pFormatter;
     const SvNumberformat* mpFormat;                            //* The format to compare against, if any
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 5b7aadb8ebd5..6e6934304444 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1162,6 +1162,17 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString,
                 F_Index = GetStandardFormat( RType, ActLnge );
             }
             break;
+        case SvNumFormatType::DATETIME :
+            // Preserve ISO 8601 input.
+            if (pStringScanner->HasIso8601Tsep())
+            {
+                F_Index = GetFormatIndex( NF_DATETIME_ISO_YYYYMMDDTHHMMSS, ActLnge );
+            }
+            else
+            {
+                F_Index = GetStandardFormat( RType, ActLnge );
+            }
+            break;
         default:
             F_Index = GetStandardFormat( RType, ActLnge );
         }


More information about the Libreoffice-commits mailing list