From 5239c649ead0344f6a8fc1bcee44a2ec9fd6ae56 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 4 Oct 2018 14:36:24 +0100 Subject: Resolves: tdf#120031 skip min/max for empty string in GetSavedIntValue so "" turns into 0, which is which we want for the single use case here in 6-1 Change-Id: I3e28b09e2ed99ab90583b087b4100efe4935414a Reviewed-on: https://gerrit.libreoffice.org/61378 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/source/control/field.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 5401e0300244..afa412a28b20 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -612,7 +612,12 @@ sal_Int64 NumericFormatter::GetValue() const sal_Int64 NumericFormatter::GetSavedIntValue() const { - return GetField() ? GetValueFromString(GetField()->GetSavedValue()) : 0; + if (!GetField()) + return 0; + const OUString& rStr = GetField()->GetSavedValue(); + if (rStr.isEmpty()) + return 0; + return GetValueFromString(rStr); } bool NumericFormatter::IsValueModified() const -- cgit v1.2.3