From: mpv Date: Fri, 2 Sep 2016 08:09:11 +0000 (+0300) Subject: Fix for the issue #1712 : avoid duplicates and not-concealed attributes usage X-Git-Tag: V_2.5.0~77 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4cdc6d4332cde1f7d1e37e0305f2c776ca2c30d0;p=modules%2Fshaper.git Fix for the issue #1712 : avoid duplicates and not-concealed attributes usage --- diff --git a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp index c39cbd4da..fd5c23cef 100644 --- a/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp +++ b/src/ModuleBase/ModuleBase_WidgetConcealedObjects.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include @@ -75,12 +77,19 @@ bool ModuleBase_WidgetConcealedObjects::restoreValueCustom() myBaseFeature->data()->referencesToObjects(aRefs); std::list > >::const_iterator anIt = aRefs.begin(), aLast = aRefs.end(); + std::set alreadyThere; // to avoid duplications for (; anIt != aLast; anIt++) { + if (!ModelAPI_Session::get()->validators()-> + isConcealed(myBaseFeature->getKind(), anIt->first)) + continue; // use only concealed attributes std::list anObjects = (*anIt).second; std::list::const_iterator anOIt = anObjects.begin(), anOLast = anObjects.end(); for (; anOIt != anOLast; anOIt++) { ResultPtr aResult = std::dynamic_pointer_cast(*anOIt); if (aResult && aResult->isConcealed()) { + if (alreadyThere.find(aResult) == alreadyThere.end()) // issue 1712, avoid duplicates + alreadyThere.insert(aResult); + else continue; int aRowId = myView->rowCount(); addViewRow(aResult); myConcealedResults[aRowId] = aResult;