summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-04 14:36:24 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2018-10-12 12:09:32 +0200
commit5239c649ead0344f6a8fc1bcee44a2ec9fd6ae56 (patch)
treee8249232b1aa24e5a030e7dec71fc6998a63cba4 /vcl
parentb3b52643983ec28838eeeed9f841b0918dc745be (diff)
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/field.cxx7
1 files changed, 6 insertions, 1 deletions
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