From: mpv Date: Tue, 23 Dec 2014 08:54:12 +0000 (+0300) Subject: Issue #294 : remove dependency between the copied part and the original one X-Git-Tag: V_0.7.0_rc1~56^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7f1e48a3f89a42631e1defa993d5ebda38e9a18d;p=modules%2Fshaper.git Issue #294 : remove dependency between the copied part and the original one --- diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp index 37ff14add..35134c64b 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp @@ -21,7 +21,6 @@ PartSetPlugin_Duplicate::PartSetPlugin_Duplicate() void PartSetPlugin_Duplicate::initAttributes() { PartSetPlugin_Part::initAttributes(); - data()->addAttribute(ORIGIN_REF(), ModelAPI_AttributeRefAttr::type()); std::shared_ptr aPManager = ModelAPI_Session::get(); std::shared_ptr aRoot = aPManager->moduleDocument(); @@ -37,12 +36,13 @@ void PartSetPlugin_Duplicate::initAttributes() if (aSource) { std::shared_ptr aCopy = aPManager->copy( aSource->data()->document(ModelAPI_ResultPart::DOC_REF())->value(), data()->name()); - data()->refattr(ORIGIN_REF())->setObject(aSource); + } else { // invalid part copy: do nothing, keep this in empty name + data()->setName(""); } } void PartSetPlugin_Duplicate::execute() { - if (data()->refattr(ORIGIN_REF())->object()) + if (!data()->name().empty()) PartSetPlugin_Part::execute(); } diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.h b/src/PartSetPlugin/PartSetPlugin_Duplicate.h index 9ace34a5c..8217ed874 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.h +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.h @@ -23,12 +23,6 @@ class PartSetPlugin_Duplicate : public PartSetPlugin_Part return MY_DUPLICATE_KIND; } - /// the reference to copy: reference to the attribute - inline static const std::string& ORIGIN_REF() - { - static const std::string MY_DUPLICATE_ID("Origin"); - return MY_DUPLICATE_ID; - } /// Makes a new part, copy of active PartSetPlugin_Duplicate();