diff options
author | Méven Car <meven.car@collabora.com> | 2024-01-26 11:46:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-01-30 10:52:43 +0100 |
commit | 96e9f6dd15a3be3526595cbbca144dd976e6fc92 (patch) | |
tree | 2fe5267f7c11adf9079b12c8654121a069fc8f04 /vcl | |
parent | 4b3f04df684354b39a2791790c2ec2a4828c83ed (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/+/162714
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/fmtfield.cxx | 8 |
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()); |