X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_AttributeRefAttr.cpp;h=0c24fe3e1b762cfa047e634473aca9408b288c2c;hb=283433d9c2f39fbd332d6eba691b6a0cd875e29d;hp=f399ba5be5405853d6c4ed7882c27d37ba30af77;hpb=96912644cf6607688466ac69f1f098fd2fff37b7;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeRefAttr.cpp b/src/Model/Model_AttributeRefAttr.cpp index f399ba5be..0c24fe3e1 100644 --- a/src/Model/Model_AttributeRefAttr.cpp +++ b/src/Model/Model_AttributeRefAttr.cpp @@ -46,7 +46,7 @@ void Model_AttributeRefAttr::setObject(ObjectPtr theObject) { // the back reference from the previous object to the attribute should be removed ObjectPtr anObject = object(); - if (theObject && (!myIsInitialized || myID->Get().Length() != 0 || object() != theObject)) { + if (theObject.get() && (!myIsInitialized || myID->Get().Length() != 0 || object() != theObject)) { REMOVE_BACK_REF(anObject); std::shared_ptr aData = std::dynamic_pointer_cast( @@ -84,6 +84,14 @@ ObjectPtr Model_AttributeRefAttr::object() return ObjectPtr(); } +bool Model_AttributeRefAttr::isInitialized() +{ + if (myRef->Get() == myRef->Label()) { // empty is not initialized: sketch parallelity + return false; + } + return ModelAPI_AttributeRefAttr::isInitialized(); +} + Model_AttributeRefAttr::Model_AttributeRefAttr(TDF_Label& theLabel) { myIsInitialized = theLabel.FindAttribute(TDataStd_Comment::GetID(), myID) == Standard_True;