summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorMéven Car <meven.car@collabora.com>2024-01-26 11:46:27 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-30 10:52:35 +0100
commite785ee257a44bd406909ef012bddde29a1fe3f0d (patch)
treed6ca80ccb3c1c188f758145cee72d0ec985ddfc7 /vcl/source/control
parent85f4395b6f40c0295a190cca09ecd51858fc3b31 (diff)
LOK: exposed time formatted field as time fields
Change-Id: Idf7613b9141c55372e19199b5641719ba42e43ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162598 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 2de4572fdff7364c98fd7c9440c4cf132206031d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162713 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/fmtfield.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx
index fc7bdfee6f58..e8b02a29c111 100644
--- a/vcl/source/control/fmtfield.cxx
+++ b/vcl/source/control/fmtfield.cxx
@@ -27,10 +27,12 @@
#include <vcl/settings.hxx>
#include <vcl/commandevent.hxx>
#include <svl/zformat.hxx>
+#include <vcl/toolkit/field.hxx>
#include <vcl/toolkit/fmtfield.hxx>
#include <vcl/uitest/uiobject.hxx>
#include <vcl/uitest/formattedfielduiobject.hxx>
#include <vcl/weld.hxx>
+#include <vcl/weldutils.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <unotools/syslocale.hxx>
#include <limits>
@@ -1352,6 +1354,12 @@ void FormattedField::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
{
SpinField::DumpAsPropertyTree(rJsonWriter);
Formatter& rFormatter = GetFormatter();
+
+ if (dynamic_cast<weld::TimeFormatter*>(&rFormatter))
+ {
+ // weld::TimeFormatter uses h24 format
+ rJsonWriter.put("type", "time");
+ }
rJsonWriter.put("min", rFormatter.GetMinValue());
rJsonWriter.put("max", rFormatter.GetMaxValue());
rJsonWriter.put("value", rFormatter.GetValue());