From 30ccf1411715e3f51e2f190bd814e8577ce239bf Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 23 Feb 2021 17:32:02 +0100 Subject: [PATCH] Gui: [skip ci] fixes #0004104: Void property value defaults to 1 --- src/Gui/QuantitySpinBox.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 4b64ecc7b2..16f0113bbd 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -89,6 +89,11 @@ public: bool validate(QString& input, Base::Quantity& result) const { + // Do not accept empty strings because the parser will consider + // " unit" as "1 unit" which is not the desired behaviour (see #0004104) + if (input.isEmpty()) + return false; + bool success = false; QString tmp = input; int pos = 0;