Salome HOME
WIP
[modules/yacs.git] / src / hmi / guiObservers.cxx
index 57d53d1b7cd3ffbee16ed4349644ce54531a9225..d8b053daf062e94da4fff637f690124acb186e9a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2014  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
@@ -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<Proc*>(_node))
@@ -902,7 +908,7 @@ void SubjectNode::saveLinks()
       Node* n2=_node;
       DEBTRACE(n1->getName()<< " " << n2->getName());
     }
-  std::set<InGate *>::const_iterator iti;
+  std::list<InGate *>::const_iterator iti;
   for(iti=singate.begin();iti != singate.end();iti++)
     {
       Node* n1=_node;
@@ -1076,7 +1082,7 @@ void SubjectNode::restoreLinks()
         }
     }
 
-  std::set<InGate *>::const_iterator it2;
+  std::list<InGate *>::const_iterator it2;
   for(it2=singate.begin();it2 != singate.end();it2++)
     {
       Node* n1=_node;
@@ -1649,8 +1655,8 @@ void SubjectComposedNode::loadLinks()
     {
       SubjectNode* sno = GuiContext::getCurrent()->_mapOfSubjectNode[*itn];
       OutGate* outgate = (*itn)->getOutGate();
-      std::set<InGate*> setIngate = outgate->edSetInGate();
-      std::set<InGate*>::const_iterator itg;
+      std::list<InGate*> setIngate = outgate->edSetInGate();
+      std::list<InGate*>::const_iterator itg;
       for(itg = setIngate.begin(); itg != setIngate.end(); ++itg)
         {
           Node* inNode = (*itg)->getNode();