]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fixed validator for Boolean feature.
authordbv <dbv@opencascade.com>
Wed, 5 Apr 2017 14:23:57 +0000 (17:23 +0300)
committerdbv <dbv@opencascade.com>
Wed, 5 Apr 2017 14:24:11 +0000 (17:24 +0300)
src/GeomValidators/GeomValidators_BooleanArguments.cpp

index 54cb1069eee9ff42f5dc077f84c0e03324d5730a..7890550f28b1b658b72b516be3fe0e98b25358f2 100644 (file)
@@ -46,6 +46,7 @@ bool GeomValidators_BooleanArguments::isValid(const std::shared_ptr<ModelAPI_Fea
         }
       } else {
         isAllInSameCompSolid = false;
+        break;
       }
     }
   }
@@ -55,18 +56,21 @@ bool GeomValidators_BooleanArguments::isValid(const std::shared_ptr<ModelAPI_Fea
   anAttrSelList = theFeature->selectionList(*anIt);
   if(anAttrSelList) {
     aToolsNb = anAttrSelList->size();
-    for(int anIndex = 0; anIndex < aToolsNb; ++anIndex) {
-      AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
-      ResultPtr aContext = anAttr->context();
-      ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
-      if(aResCompSolidPtr.get()) {
-        if(aCompSolid.get()) {
-          isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+    if(isAllInSameCompSolid) {
+      for(int anIndex = 0; anIndex < aToolsNb; ++anIndex) {
+        AttributeSelectionPtr anAttr = anAttrSelList->value(anIndex);
+        ResultPtr aContext = anAttr->context();
+        ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
+        if(aResCompSolidPtr.get()) {
+          if(aCompSolid.get()) {
+            isAllInSameCompSolid = aCompSolid == aResCompSolidPtr;
+          } else {
+            aCompSolid = aResCompSolidPtr;
+          }
         } else {
-          aCompSolid = aResCompSolidPtr;
+          isAllInSameCompSolid = false;
+          break;
         }
-      } else {
-        isAllInSameCompSolid = false;
       }
     }
   }