From: vsv Date: Mon, 25 May 2015 12:17:02 +0000 (+0300) Subject: Issue #559: Control doesn't have variable if its text is empty X-Git-Tag: V_1.2.0~98 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0cea3be102af7247b2fe2c8035a1bb38b7bf82ae;p=modules%2Fshaper.git Issue #559: Control doesn't have variable if its text is empty --- 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); }