]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #559: Control doesn't have variable if its text is empty
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 25 May 2015 12:17:02 +0000 (15:17 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 25 May 2015 12:17:02 +0000 (15:17 +0300)
src/ModuleBase/ModuleBase_ParamSpinBox.cpp

index cce85ab35a9d451db0748d433ab27e9e4f678d1e..5501b26551f687b66e19c316bc38bf65c22b8981 100644 (file)
@@ -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);
 }