summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-27 21:11:12 +0200
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-03-02 20:40:38 +0100
commit7a80d8b4c5379d2cbad02a16ddf82dae35821c52 (patch)
tree67edca956b35afbda3affc783e15a9a6284fb11d
parent324b9e04799ba56f4f19535d2775c168b80b907c (diff)
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@collabora.co.uk> (cherry picked from commit 9cb07cdca78e2cb1ecff84b7a8e154b23cc2a46d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89795 Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
-rw-r--r--include/vcl/vclenum.hxx5
-rw-r--r--vcl/source/control/field2.cxx26
2 files changed, 30 insertions, 1 deletions
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 95650b2ed889..3ae12c0373f7 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 7652af9dd165..6b8820424616 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -2612,6 +2612,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!" );
}