X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftypicals%2FTypicalUtil.java;h=e15f5036d9be684d25fe5f2e7d8b315b229f8b36;hp=9c29290a50e03e2e1da3e01c6afc591aa6b4d9ea;hb=621bec7b0f646eb559d24d01183bc8c5c3bbef1a;hpb=fd452722e97db9cf876f4f03a9e44fe750625a92 diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java index 9c29290a5..e15f5036d 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java @@ -619,15 +619,19 @@ public class TypicalUtil { // Attach the same symbol contributions to the created typical // diagram type as are attached to the model-designated // contribution source diagram type. + boolean clonedIndexRootContribution = false; for (Resource symbolContributionSource : cloneSymbolContributionsFrom) { for (Resource contribution : graph.getObjects(symbolContributionSource, DIA.HasSymbolContribution)) { graph.claim(diagramType, DIA.HasSymbolContribution, contribution); + clonedIndexRootContribution |= graph.isInstanceOf(contribution, DIA.IndexRootSymbolContribution); } } - Resource indexContribution = graph.newResource(); - graph.claim(indexContribution, L0.InstanceOf, DIA.IndexRootSymbolContribution); - graph.claim(diagramType, DIA.HasSymbolContribution, indexContribution); + if (!clonedIndexRootContribution) { + Resource indexContribution = graph.newResource(); + graph.claim(indexContribution, L0.InstanceOf, DIA.IndexRootSymbolContribution); + graph.claim(diagramType, DIA.HasSymbolContribution, indexContribution); + } // Add comment to change set. CommentMetadata cm = graph.getMetadata(CommentMetadata.class);