vcl/source/control/fmtfield.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 447bc69b6c32bb91bfc8f3dcc43a08c38a3a2c32 Author: Dennis Francis <[email protected]> AuthorDate: Fri Oct 31 16:26:56 2025 +0530 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Tue Nov 4 09:41:00 2025 +0100 lok: FormattedField: ensure formatter has min and max If not use the limits of a 32 bit integer. Without this check if min/max are not set already, the json min/max will be set to 0/0 which is problematic in web clients where it rejects all inputs. Signed-off-by: Dennis Francis <[email protected]> Change-Id: I9fa2bb68b47626ad42bae51e52e4b14baecb82fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193259 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx index ec8f5569ecab..37a205f92574 100644 --- a/vcl/source/control/fmtfield.cxx +++ b/vcl/source/control/fmtfield.cxx @@ -1360,8 +1360,8 @@ void FormattedField::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) // weld::TimeFormatter uses h24 format rJsonWriter.put("type", "time"); } - rJsonWriter.put("min", rFormatter.GetMinValue()); - rJsonWriter.put("max", rFormatter.GetMaxValue()); + rJsonWriter.put("min", rFormatter.HasMinValue() ? rFormatter.GetMinValue() : std::numeric_limits<sal_Int32>::min()); + rJsonWriter.put("max", rFormatter.HasMaxValue() ? rFormatter.GetMaxValue() : std::numeric_limits<sal_Int32>::max()); rJsonWriter.put("value", rFormatter.GetValue()); rJsonWriter.put("step", rFormatter.GetSpinSize()); }
