From 9a148f9505c1606890e6269d133fc6d746384d6e Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 11 Sep 2014 09:47:57 +0400 Subject: [PATCH] Issue #99 fix --- src/Model/Model_Update.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 9df4d10f0..875d22dd1 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,25 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) aMustbeUpdated = true; } } + // reference to attribute or object + list > aRefAttrs = theFeature->data()->attributes( + ModelAPI_AttributeRefAttr::type()); + for (aRefsIter = aRefAttrs.begin(); aRefsIter != aRefAttrs.end(); aRefsIter++) { + boost::shared_ptr aRef = + boost::dynamic_pointer_cast(*aRefsIter); + if (!aRef) continue; + if (aRef->isObject()) { + boost::shared_ptr aSub = aRef->object(); + if (updateObject(aSub)) { + aMustbeUpdated = true; + } + } else if (aRef->attr()) { // reference to the attribute + boost::shared_ptr aSub = aRef->attr()->owner(); + if (updateObject(aSub)) { + aMustbeUpdated = true; + } + } + } // lists of references aRefs = theFeature->data()->attributes(ModelAPI_AttributeRefList::type()); for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) { -- 2.39.2