Salome HOME
Tests fix
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Validators.cpp
index 1b8c4d13e871d61edfa328944ca53298e0c9d75c..aa78551d6b665e30f0dcf7a03d678694efa7bb1a 100644 (file)
@@ -906,10 +906,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);
@@ -1688,8 +1685,10 @@ bool FeaturesPlugin_ValidatorBooleanCommonSelection::isValid(
     }
     std::shared_ptr<GeomAPI_Shape> aShape = anAttrSelection->value();
     GeomShapePtr aContextShape;
-    if (!aShape.get() && aContext.get()) {
+    if (aContext.get()) {
       aContextShape = aContext->shape();
+    }
+    if (!aShape.get()) {
       aShape = aContextShape;
     }
     if (!aShape.get()) {