From: vsv Date: Mon, 15 May 2017 13:19:20 +0000 (+0300) Subject: Issue #2163: Prevent recursive iteration on list update X-Git-Tag: V_2.7.1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=466efa0fb1c251c4fafbecf89bdd0b5336ee9113;p=modules%2Fshaper.git Issue #2163: Prevent recursive iteration on list update --- diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index be7aa91ec..02735cc94 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -329,7 +329,7 @@ QList ParametersPlugin_WidgetParamsMgr:: for(aIt = aRefs.cbegin(); aIt != aRefs.cend(); aIt++) { std::shared_ptr aAttr = (*aIt); FeaturePtr aReferenced = std::dynamic_pointer_cast(aAttr->owner()); - if (aReferenced.get()) { + if (aReferenced.get() && (aReferenced != aParameter)) { if (aReferenced->getKind() == ParametersPlugin_Parameter::ID()) { // Find referenced feature Recursive QList aList; @@ -758,16 +758,14 @@ void ParametersPlugin_WidgetParamsMgr::enableButtons(bool theEnable) bool ParametersPlugin_WidgetParamsMgr::isValid() { QTreeWidgetItem* aItem; - bool aIsValid = true; for(int i = 0; i < myParameters->childCount(); i++) { aItem = myParameters->child(i); if ((aItem->text(Col_Name) == NoName) || (aItem->text(Col_Equation) == NoValue) || (!ModelAPI_Expression::isVariable(aItem->text(Col_Name).toStdString())) ) { - aIsValid = false; - break; + return false; } } - return aIsValid; + return true; }