From: nds Date: Mon, 22 Jun 2015 13:18:09 +0000 (+0300) Subject: Crash fix for the SALOME version if the local is russian. X-Git-Tag: V_1.3.0~214 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6cb0856856b41fcd5fbaa02db2da46b359d9172c;p=modules%2Fshaper.git Crash fix for the SALOME version if the local is russian. --- diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp index 5e59599a3..34f7bcb6d 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp @@ -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; + } /*!