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);
}
}
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);
+ }
}
}