]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make same planes cannot be used twice in partition tool
authormpv <mikhail.ponikarov@opencascade.com>
Thu, 3 Mar 2016 09:36:38 +0000 (12:36 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Thu, 3 Mar 2016 09:36:38 +0000 (12:36 +0300)
src/Model/Model_AttributeSelectionList.cpp

index 85f522a6e44ebb1dc3fa019da73c62398a2c9b58..56f82cc6a142b9eed07722d3be44db8067d644a7 100644 (file)
@@ -191,9 +191,18 @@ bool Model_AttributeSelectionList::isInList(const ResultPtr& theContext,
 {
   for(int anIndex = size() - 1; anIndex >= 0; anIndex--) {
     AttributeSelectionPtr anAttr = value(anIndex);
-    if (anAttr.get() && anAttr->value().get()) {
-      if (anAttr->context() == theContext && anAttr->value()->isEqual(theSubShape))
-        return true;
+    if (anAttr.get()) {
+      if (anAttr->context() == theContext) { // contexts are equal, so, check that values are also
+        std::shared_ptr<GeomAPI_Shape> aValue = anAttr->value();
+        if (!aValue.get()) {
+          if (!theSubShape.get()) { // both are null
+            return true;
+          }
+        } else {
+          if (aValue->isEqual(theSubShape)) // shapes are equal
+            return true;
+        }
+      }
     }
   }
   return false;