From 6cb0856856b41fcd5fbaa02db2da46b359d9172c Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 22 Jun 2015 16:18:09 +0300 Subject: [PATCH] Crash fix for the SALOME version if the local is russian. --- src/ModuleBase/ModuleBase_ParamSpinBox.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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; + } /*! -- 2.39.2