* Bug #15207 fixed : `xcos(scs_m)` did not work for sub-systems.
[scilab.git] / scilab / modules / xcos / src / java / org / scilab / modules / xcos / Xcos.java
index 55b3540..e79dae1 100644 (file)
@@ -498,10 +498,10 @@ public final class Xcos {
             /*
              * Allocate and setup a new diagram
              */
-            diag = new XcosDiagram(controller, currentId, Kind.DIAGRAM, "");
+            diag = new XcosDiagram(controller, currentId, controller.getKind(currentId), "");
             diag.installListeners();
 
-            root = new ScicosObjectOwner(controller, diag.getUID(), Kind.DIAGRAM);
+            root = findRoot(controller, diag);
             addDiagram(root, diag);
 
             /*