Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Validators.cpp
index d46d2931622106b6f6366580cd1e943c95893d2f..ccb43b40643951035c1df9b12e70711e5bcb9576 100644 (file)
@@ -547,6 +547,11 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
       if(aContext.get()) {
         aDirShape = aContext->shape();
       }
+
+      if (aDirShape.get() && aDirShape->isCompound()) {
+        GeomAPI_ShapeIterator anIt(aDirShape);
+        aDirShape = anIt.current();
+      }
     }
   }
 
@@ -906,10 +911,7 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt
     return false;
   }
 
-  ListOfShape aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
-  // add to the list all sub-shapes of the compound due to they can be selected as a shapes to keep
-  for (GeomAPI_ShapeIterator anIt(aBaseShape); anIt.more(); anIt.next())
-    aSubShapes.push_back(anIt.current());
+  std::list<GeomShapePtr> aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
   for(int anIndex = 0; anIndex < aSubShapesAttrList->size(); ++anIndex) {
     bool isSameFound = false;
     AttributeSelectionPtr anAttrSelectionInList = aSubShapesAttrList->value(anIndex);