Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / PartSetPlugin / PartSetPlugin_Duplicate.cpp
index f8ebfd9006d1f522e90b164d0bf47c4f1a56488e..a2f006fa42880133ca20e36835d2a5f534517cf3 100644 (file)
@@ -21,19 +21,19 @@ void PartSetPlugin_Duplicate::initAttributes()
   data()->addAttribute(ORIGIN_REF(), ModelAPI_AttributeRefAttr::type());
 
   boost::shared_ptr<ModelAPI_Session> aPManager = ModelAPI_Session::get();
-  boost::shared_ptr<ModelAPI_Document> aRoot = aPManager->rootDocument();
+  boost::shared_ptr<ModelAPI_Document> aRoot = aPManager->moduleDocument();
   boost::shared_ptr<ModelAPI_ResultPart> aSource;  // searching for source document attribute
   for (int a = aRoot->size(getGroup()) - 1; a >= 0; a--) {
     aSource = boost::dynamic_pointer_cast<ModelAPI_ResultPart>(aRoot->object(getGroup(), a));
     if (aSource && aSource->data()
-        && aSource->data()->docRef(ModelAPI_ResultPart::DOC_REF())->value()
-            == aPManager->currentDocument())
+        && aSource->data()->document(ModelAPI_ResultPart::DOC_REF())->value()
+            == aPManager->activeDocument())
       break;
     aSource.reset();
   }
   if (aSource) {
     boost::shared_ptr<ModelAPI_Document> aCopy = aPManager->copy(
-        aSource->data()->docRef(ModelAPI_ResultPart::DOC_REF())->value(), data()->name());
+        aSource->data()->document(ModelAPI_ResultPart::DOC_REF())->value(), data()->name());
     data()->refattr(ORIGIN_REF())->setObject(aSource);
   }
 }