From 0cea3be102af7247b2fe2c8035a1bb38b7bf82ae Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 25 May 2015 15:17:02 +0300 Subject: [PATCH] Issue #559: Control doesn't have variable if its text is empty --- src/ModuleBase/ModuleBase_ParamSpinBox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp index cce85ab35..5501b2655 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp @@ -157,12 +157,14 @@ bool ModuleBase_ParamSpinBox::isAcceptVariables() const bool ModuleBase_ParamSpinBox::hasVariable() const { + if (myTextValue.isEmpty()) + return false; return hasVariable(myTextValue); } bool ModuleBase_ParamSpinBox::hasVariable(const QString& theText) const { - QRegExp varNameMask("[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?"); + QRegExp varNameMask("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"); return !varNameMask.exactMatch(theText); } -- 2.39.2