vcl/source/control/fmtfield.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 2de4572fdff7364c98fd7c9440c4cf132206031d Author: Méven Car <meven....@collabora.com> AuthorDate: Fri Jan 26 11:46:27 2024 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Jan 29 10:02:11 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> diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx index 4504b63c23b3..e4b1f1dbfb46 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> @@ -1358,6 +1360,12 @@ void FormattedField::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) { SpinField::DumpAsPropertyTree(rJsonWriter); Formatter& rFormatter = GetFormatter(); + + if (weld::TimeFormatter* timeFormatter = 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());