From: Reino Ruusu Date: Thu, 12 Mar 2020 13:50:07 +0000 (+0200) Subject: Fix error in assigment of component name for new components X-Git-Tag: v1.43.0~34 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F3991%2F1;p=simantics%2F3d.git Fix error in assigment of component name for new components gitlab #74 Change-Id: Ie7b4b9b7459763031176039de9b448f54f9f490f --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java index a1ac7f82..31bdda9e 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java @@ -378,9 +378,6 @@ public class ComponentUtils { public static PipelineComponent addComponent(P3DRootNode root, PipelineComponent component, InsertInstruction inst) throws Exception { PipelineComponent newComponent = ComponentUtils.createComponent(root, inst.typeUri); - if (inst.name != null) - newComponent.setName(inst.name); - PipeControlPoint newPcp = newComponent.getControlPoint(); PipeControlPoint toPcp = component.getControlPoint(); @@ -471,8 +468,12 @@ public class ComponentUtils { } } - String name = component.getPipeRun().getUniqueName(typeName); - newComponent.setName(name); + if (inst.name != null) { + newComponent.setName(inst.name); + } else { + String name = component.getPipeRun().getUniqueName(typeName); + newComponent.setName(name); + } pipeRun.addChild(newComponent); if (newPcp.isSizeChange())