From 374b4dd23d6d35b4ce83be2bc26690a2c2cdf581 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 3 Jul 2015 16:40:52 +0300 Subject: [PATCH] Fix for 671: if it is not case, do not use it as reference to objects --- src/Model/Model_Data.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 36f012028..347a21820 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -378,12 +378,22 @@ void Model_Data::updateConcealmentFlag() } } +#include + void Model_Data::referencesToObjects( std::list > >& theRefs) { + static Model_ValidatorsFactory* aValidators = + static_cast(ModelAPI_Session::get()->validators()); + FeaturePtr aMyFeature = std::dynamic_pointer_cast(myObject); + std::map >::iterator anAttr = myAttrs.begin(); std::list aReferenced; // not inside of cycle to avoid excess memory menagement for(; anAttr != myAttrs.end(); anAttr++) { + // skip not-case attributres, that really may refer to anything not-used (issue 671) + if (aMyFeature.get() && !aValidators->isCase(aMyFeature, anAttr->second->id())) + continue; + std::string aType = anAttr->second->attributeType(); if (aType == ModelAPI_AttributeReference::typeId()) { // reference to object std::shared_ptr aRef = std::dynamic_pointer_cast< -- 2.39.2