From: spo Date: Mon, 6 Jul 2015 08:52:46 +0000 (+0300) Subject: Issue #588: Renaming a parameter used in an expression X-Git-Tag: V_1.3.0~106 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3184ebb3d8cff3ebc3108a6489c7df8bb5136b2d;p=modules%2Fshaper.git Issue #588: Renaming a parameter used in an expression --- diff --git a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp index 96e280436..c32723cfb 100644 --- a/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp +++ b/src/ParametersPlugin/ParametersPlugin_EvalListener.cpp @@ -296,29 +296,6 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent( aDocList.push_back(aRootDocument); } - // Find parameters and rename in its expressions - for (std::list::const_iterator aDicumentIt = aDocList.begin(); - aDicumentIt != aDocList.end(); ++aDicumentIt) { - const DocumentPtr& aDocument = *aDicumentIt; - const int aSize = aDocument->size(ModelAPI_ResultParameter::group()); - for (int anIndex = 0; anIndex < aSize; ++anIndex) { - ResultParameterPtr aResultParameter = - std::dynamic_pointer_cast( - aDocument->object(ModelAPI_ResultParameter::group(), anIndex)); - if (!aResultParameter.get()) - continue; - - std::shared_ptr aParameter = - std::dynamic_pointer_cast( - aDocument->feature(aResultParameter)); - if (!aParameter.get()) - continue; - - // Rename - renameInParameter(aParameter, aMessage->oldName(), aMessage->newName()); - } - } - // Find all features for (std::list::const_iterator aDicumentIt = aDocList.begin(); aDicumentIt != aDocList.end(); ++aDicumentIt) { @@ -328,6 +305,15 @@ void ParametersPlugin_EvalListener::processObjectRenamedEvent( for (; aFeatureIt != aFeatures.end(); ++aFeatureIt) { const FeaturePtr& aFeature = *aFeatureIt; + // If Parameter feature then rename its expression + std::shared_ptr aParameter = + std::dynamic_pointer_cast(aFeature); + if (aParameter.get()) { + // Rename + renameInParameter(aParameter, aMessage->oldName(), aMessage->newName()); + continue; + } + // Find all attributes std::list anAttributes = aFeature->data()->attributes(std::string()); std::list::const_iterator anAttributeIt = anAttributes.begin();