X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultPart.cpp;h=a54ca670999c64d005f81c59f45d2a4712baf07e;hb=1b9dd3633d644c358424227423b330e9551be38f;hp=cc1666e5b3a43976ba1d61d718bebbcc69565d1d;hpb=f1cd93fd02a54259f72e3191d037323a496b2bef;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index cc1666e5b..a54ca6709 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -28,7 +28,7 @@ void Model_ResultPart::setData(std::shared_ptr theData) { ModelAPI_Result::setData(theData); if (theData) { - data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::type()); + data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::typeId()); } } @@ -36,12 +36,19 @@ void Model_ResultPart::activate() { std::shared_ptr aDocRef = data()->document(DOC_REF()); - if (!aDocRef->value()) { // create (or open) a document if it is not yet created + if (!aDocRef->value().get()) { // create (or open) a document if it is not yet created std::shared_ptr aDoc = document()->subDocument(data()->name()); if (aDoc) { aDocRef->setValue(aDoc); } } - if (aDocRef->value()) + if (aDocRef->value().get()) { ModelAPI_Session::get()->setActiveDocument(aDocRef->value()); + } +} + +bool Model_ResultPart::isActivated() +{ + std::shared_ptr aDocRef = data()->document(DOC_REF()); + return aDocRef->value().get(); }