From: vsv Date: Wed, 20 Mar 2019 08:54:05 +0000 (+0300) Subject: Issue #2888: Use only ASCII symbols for parameters names X-Git-Tag: V9_3_0b2~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7e53f1f8e2c957ba2af48b650b94b460236e6fc8;p=modules%2Fshaper.git Issue #2888: Use only ASCII symbols for parameters names --- diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index 104eee456..9ec6c6b28 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -147,11 +147,27 @@ bool canRemoveOrRename(QWidget* theParent, const std::set& theFeatur return aResult; } +//****************************************************************** +bool isAscii(const QString& theStr) +{ + char aCh; + for (int i = 0; i < theStr.size(); i++) { + aCh = theStr[i].toLatin1(); + if (aCh == 0) + return false; + } + return true; +} + //****************************************************************** bool canRename(const ObjectPtr& theObject, const QString& theName) { std::string aType = theObject->groupName(); if (aType == ModelAPI_ResultParameter::group()) { + // For parameters names only ASCII symbols have to be used + if (!isAscii(theName)) + return false; + double aValue; ResultParameterPtr aParam; if (ModelAPI_Tools::findVariable(theObject->document(), diff --git a/src/XGUI/XGUI_Tools.h b/src/XGUI/XGUI_Tools.h index 98178651f..2bcb33228 100644 --- a/src/XGUI/XGUI_Tools.h +++ b/src/XGUI/XGUI_Tools.h @@ -109,6 +109,12 @@ bool XGUI_EXPORT canRemoveOrRename(QWidget* theParent, const std::set