From: mpv Date: Thu, 3 Mar 2016 09:36:38 +0000 (+0300) Subject: Make same planes cannot be used twice in partition tool X-Git-Tag: V_2.2.0~20^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=220bd2b37119be1c65abf88a88792445cb9d99f8;p=modules%2Fshaper.git Make same planes cannot be used twice in partition tool --- diff --git a/src/Model/Model_AttributeSelectionList.cpp b/src/Model/Model_AttributeSelectionList.cpp index 85f522a6e..56f82cc6a 100644 --- a/src/Model/Model_AttributeSelectionList.cpp +++ b/src/Model/Model_AttributeSelectionList.cpp @@ -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 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;