vcl/source/control/fmtfield.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 96e9f6dd15a3be3526595cbbca144dd976e6fc92 Author: Méven Car <meven....@collabora.com> AuthorDate: Fri Jan 26 11:46:27 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Jan 30 10:52:43 2024 +0100 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.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 2de4572fdff7364c98fd7c9440c4cf132206031d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162714 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> 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());