[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - include/vcl vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 2 20:18:11 UTC 2020


 include/vcl/vclenum.hxx       |    5 ++++-
 vcl/source/control/field2.cxx |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

New commits:
commit bccd604d1d1024943fb79377e7ff11d84e14760d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Feb 27 21:11:12 2020 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Mon Mar 2 21:17:39 2020 +0100

    tdf#130515 Time field in Base form will not display correct format
    
    regression from
        commit 65b7b6322b662785bf032e66c76abc36c9a2bb0e
        Date:   Wed Feb 8 10:40:28 2017 +0200
        loplugin:unusedenumconstants read-only constants in vcl
    
    Change-Id: Icf2e385763c8ece34521895331d148a5baacf2d1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89706
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit 9cb07cdca78e2cb1ecff84b7a8e154b23cc2a46d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89796
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 1e8f59428e3f..f79869816fb3 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -147,7 +147,10 @@ enum class TimeFormat
 
 enum class ExtTimeFieldFormat
 {
-    Short24H, Long24H
+    /** the first 4 of these are only used by base/dbaccess */
+    Short24H, Long24H,
+    Short12H, Long12H,
+    ShortDuration, LongDuration
 };
 
 enum class ExtDateFieldFormat
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index bb2ea4db56ee..adc36f48aec2 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -2617,6 +2617,32 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat )
             SetFormat( TimeFieldFormat::F_SEC );
         }
         break;
+        case ExtTimeFieldFormat::Short12H:
+        {
+            SetTimeFormat( TimeFormat::Hour12 );
+            SetDuration( false );
+            SetFormat( TimeFieldFormat::F_NONE );
+        }
+        break;
+        case ExtTimeFieldFormat::Long12H:
+        {
+            SetTimeFormat( TimeFormat::Hour12 );
+            SetDuration( false );
+            SetFormat( TimeFieldFormat::F_SEC );
+        }
+        break;
+        case ExtTimeFieldFormat::ShortDuration:
+        {
+            SetDuration( true );
+            SetFormat( TimeFieldFormat::F_NONE );
+        }
+        break;
+        case ExtTimeFieldFormat::LongDuration:
+        {
+            SetDuration( true );
+            SetFormat( TimeFieldFormat::F_SEC );
+        }
+        break;
         default:    OSL_FAIL( "ExtTimeFieldFormat unknown!" );
     }
 


More information about the Libreoffice-commits mailing list