From: mpv Date: Tue, 16 May 2017 14:42:26 +0000 (+0300) Subject: Fix for the issue #2165 : reuse of the variable in expression of this variable is... X-Git-Tag: V_2.7.1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eaedcd1720f0934b53748dcfdd4d9ae6d7c02ffe;p=modules%2Fshaper.git Fix for the issue #2165 : reuse of the variable in expression of this variable is not allowed now. --- diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 963a0c31d..988cfd64d 100755 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -167,8 +167,12 @@ bool findVariable(const DocumentPtr& theDocument, FeaturePtr theSearcher, if (!theParam.get()) return false; // avoid usage of parameters created later than the initial parameter - if (theSearcher.get() && theDocument->isLater(theDocument->feature(theParam), theSearcher)) - return false; + + if (theSearcher.get()) { + FeaturePtr aParamFeat = theDocument->feature(theParam); + if (aParamFeat == theSearcher || theDocument->isLater(aParamFeat, theSearcher)) + return false; + } AttributeDoublePtr aValueAttribute = theParam->data()->real(ModelAPI_ResultParameter::VALUE()); outValue = aValueAttribute->value(); return true;