X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FModel_AttributeDocRef.cpp;h=dfb307f4dbfe0981cc8915fc838cea6a798540a4;hb=4ee6972a725f02500c2c543abeef2909180e09c1;hp=82492e2d6dcac4b2850f46a12f67012823677d4e;hpb=502609e3fb08fe0ac9ffd1cfa3025f67189391ca;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeDocRef.cpp b/src/Model/Model_AttributeDocRef.cpp index 82492e2d6..dfb307f4d 100644 --- a/src/Model/Model_AttributeDocRef.cpp +++ b/src/Model/Model_AttributeDocRef.cpp @@ -16,7 +16,7 @@ void Model_AttributeDocRef::setValue(boost::shared_ptr theDoc myComment->Set(TCollection_ExtendedString(theDoc->id().c_str())); static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED); - Model_FeatureUpdatedMessage aMsg(feature(), anEvent); + Model_FeatureUpdatedMessage aMsg(owner(), anEvent); Events_Loop::loop()->send(aMsg); } } @@ -36,5 +36,11 @@ Model_AttributeDocRef::Model_AttributeDocRef(TDF_Label& theLabel) if (!theLabel.FindAttribute(TDataStd_Comment::GetID(), myComment)) { // create attribute: not initialized by value yet, just empty string myComment = TDataStd_Comment::Set(theLabel, ""); + } else { // document was already referenced: try to set it as loaded by demand + Handle(Model_Application) anApp = Model_Application::getApplication(); + string anID(TCollection_AsciiString(myComment->Get()).ToCString()); + if (!anApp->hasDocument(anID)) { + anApp->setLoadByDemand(anID); + } } }