X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FParametersPlugin%2FParametersPlugin_Validators.cpp;h=3bd228d2a666805c60f71b3d962946054b8293c7;hb=04e2497fc973f0afc95d0a4a6f95e37fb27f45e8;hp=aaa647d9d124d502a4576e52fd2f3c9ae4ffbcdf;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/ParametersPlugin/ParametersPlugin_Validators.cpp b/src/ParametersPlugin/ParametersPlugin_Validators.cpp index aaa647d9d..3bd228d2a 100644 --- a/src/ParametersPlugin/ParametersPlugin_Validators.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Validators.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include @@ -24,6 +23,8 @@ #include +#include + #include #include #include @@ -39,7 +40,7 @@ ParametersPlugin_VariableValidator::~ParametersPlugin_VariableValidator() } bool ParametersPlugin_VariableValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { AttributeStringPtr aStrAttr = std::dynamic_pointer_cast(theAttribute); @@ -72,7 +73,7 @@ bool ParametersPlugin_VariableValidator::isUnique(const AttributePtr& theAttribu for (int anIndex = 0, aSize = aDocument->size(ModelAPI_ResultParameter::group()); anIndex < aSize; ++anIndex) { ObjectPtr aParamObj = aDocument->object(ModelAPI_ResultParameter::group(), anIndex); - if (aParamObj->data()->name() != theString) + if (Locale::Convert::toString(aParamObj->data()->name()) != theString) continue; ResultParameterPtr aParam = std::dynamic_pointer_cast(aParamObj); if (!aParam.get()) @@ -96,12 +97,10 @@ ParametersPlugin_ExpressionValidator::~ParametersPlugin_ExpressionValidator() } bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, + const std::list& /*theArguments*/, Events_InfoMessage& theError) const { FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); - ResultParameterPtr aParam = - std::dynamic_pointer_cast(aFeature->firstResult()); AttributeStringPtr aStrAttr = std::dynamic_pointer_cast(theAttribute); @@ -116,11 +115,6 @@ bool ParametersPlugin_ExpressionValidator::isValid(const AttributePtr& theAttrib return false; } - if (!aParam.get()) { - theError = "Result is empty."; - return false; - } - theError = aFeature->string(ParametersPlugin_Parameter::EXPRESSION_ERROR_ID())->value(); return theError.empty(); }