From 220bd2b37119be1c65abf88a88792445cb9d99f8 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 3 Mar 2016 12:36:38 +0300 Subject: [PATCH] Make same planes cannot be used twice in partition tool --- src/Model/Model_AttributeSelectionList.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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; -- 2.39.2