void Model_Document::updateHistory(const std::shared_ptr<ModelAPI_Object> theObject)
{
- myObjs->updateHistory(theObject);
+ if (myObjs)
+ myObjs->updateHistory(theObject);
}
void Model_Document::updateHistory(const std::string theGroup)
{
- myObjs->updateHistory(theGroup);
+ if (myObjs)
+ myObjs->updateHistory(theGroup);
}
const std::set<int> Model_Document::subDocuments() const
if (!aRefFeat.get()) { // take feature of the result
aRefFeat = feature(std::dynamic_pointer_cast<ModelAPI_Result>(aRefObj));
}
- if (aRefFeat.get() && aRefFeat == theThis) {
- return false; // other references to this, so other later than this
+ if (aRefFeat.get()) {
+ if (aRefFeat == theThis)
+ return false; // other references to this, so other later than this
+ if (std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aRefFeat)) {
+ if (!isLaterByDep(theThis, aRefFeat)) // nested composites: recursion
+ return false;
+ }
}
}
}