Xcos MVC: do not link new ports with old links 01/18801/3
Paul Bignier [Mon, 19 Dec 2016 16:24:47 +0000 (17:24 +0100)]
 * When cloning a block, the new ports were connected to the old links
 * This code section imitats Controller::deepClone()

Change-Id: I8b2f6e189d48bd052616c709c98d1adcc692eef9

scilab/modules/scicos/src/cpp/Controller.cpp

index 951f44a..4b97df0 100644 (file)
@@ -496,7 +496,7 @@ void Controller::deepCloneVector(std::map<model::BaseObject*, model::BaseObject*
             }
             else
             {
-                cloned.push_back(getObject(id));
+                cloned.push_back(nullptr);
             }
         }
     }
@@ -504,7 +504,7 @@ void Controller::deepCloneVector(std::map<model::BaseObject*, model::BaseObject*
     // update the ScicosID related properties after cloning all the objects
     if (p == CHILDREN)
     {
-        for (auto const& it : mapped)
+        for (auto const & it : mapped)
         {
             model::BaseObject* initial = it.first;
             model::BaseObject* cloned = it.second;