]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Crash fix for the SALOME version if the local is russian.
authornds <natalia.donis@opencascade.com>
Mon, 22 Jun 2015 13:18:09 +0000 (16:18 +0300)
committernds <natalia.donis@opencascade.com>
Mon, 22 Jun 2015 13:18:09 +0000 (16:18 +0300)
src/ModuleBase/ModuleBase_ParamSpinBox.cpp

index 5e59599a3c42b943aa5057b24cb82ae078c2635c..34f7bcb6d25339de0e11febd42a10088db438342 100644 (file)
@@ -165,10 +165,21 @@ bool ModuleBase_ParamSpinBox::hasVariable() const
 
 bool ModuleBase_ParamSpinBox::hasVariable(const QString& theText) const
 {
-  QString aPattern = QString("[-+]?[0-9]*[%1]?[0-9]+([eE][-+]?[0-9]+)?")
-      .arg(QLocale::system().decimalPoint());
-  QRegExp varNameMask(aPattern);
-  return !varNameMask.exactMatch(theText);
+  QString aDigitPattern = QString("[-+]?[0-9]*[%1]?[0-9]+([eE][-+]?[0-9]+)?");
+
+  bool aHasDigit = false;
+  {
+    QRegExp varNameMask(aDigitPattern.arg("."));
+    aHasDigit = varNameMask.exactMatch(theText);
+  }
+  if (!aHasDigit)
+  {
+    QRegExp varNameMask(aDigitPattern.arg(","));
+    aHasDigit = varNameMask.exactMatch(theText);
+  }
+
+  return !aHasDigit;
+
 }
 
 /*!