From: Tuukka Lehtonen Date: Sat, 17 Sep 2016 11:37:47 +0000 (+0300) Subject: Merge commit '621bec7' X-Git-Tag: v1.25.0~110 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=23755ed9225d2e231bcde85c5f6a36d1e1040c16;hp=04c69e99fce8461b0c4ca57ca97790ac8c6ea495 Merge commit '621bec7' --- 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);