X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fhmi%2FguiObservers.cxx;h=d8b053daf062e94da4fff637f690124acb186e9a;hb=c9208a8ef7f32a620d9650908588320ff159a167;hp=84f1c5a5476136330c75039e1c23d58445a839ae;hpb=c971f99371af3cdbe21daa611ebc89806d0e26c1;p=modules%2Fyacs.git diff --git a/src/hmi/guiObservers.cxx b/src/hmi/guiObservers.cxx index 84f1c5a54..d8b053daf 100644 --- a/src/hmi/guiObservers.cxx +++ b/src/hmi/guiObservers.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2006-2015 CEA/DEN, EDF R&D +// Copyright (C) 2006-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -622,7 +622,7 @@ void SubjectNode::registerUndoDestroy() Bloc *undoBloc = new Bloc(blocName.str()); undoProc->edAddChild(undoBloc); ComposedNode *newFather = undoBloc; - Node *clone = _node->clone(0); + Node *clone = _node->cloneWithoutCompAndContDeepCpy(0); newFather->edAddChild(clone); // --- register a CommandCopyNode from undoProc @@ -824,6 +824,12 @@ bool SubjectNode::copy(Subject* parent) YASSERT(cnp); Proc *proc = GuiContext::getCurrent()->getProc(); Proc *fromproc=_node->getProc(); + if(proc != fromproc) + { + GuiContext::getCurrent()->_lastErrorMessage = "It is not possible to paste an object from one schema to another."; + DEBTRACE(GuiContext::getCurrent()->_lastErrorMessage); + return false; + } string position = ""; if (fromproc != dynamic_cast(_node))