X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftypicals%2Frules%2FPageSettingsTypicalRule.java;fp=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftypicals%2Frules%2FPageSettingsTypicalRule.java;h=799579377a614aecf4e15aa8e0ceacc241572b56;hb=eeee0f5dd6aed683ec915f46811c577e30593cfc;hp=4ee96f75d8e062fad53dea40bc81e30c997e5b2a;hpb=f93d655be757bc3ccea8f2733a00eab1bd065351;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/rules/PageSettingsTypicalRule.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/rules/PageSettingsTypicalRule.java index 4ee96f75d..799579377 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/rules/PageSettingsTypicalRule.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/rules/PageSettingsTypicalRule.java @@ -23,7 +23,14 @@ public enum PageSettingsTypicalRule implements ITypicalSynchronizationRule { @Override public boolean synchronize(WriteGraph graph, Resource template, Resource instance, TypicalInfo info) throws DatabaseException { + // Diagrams should always have some sort of diagram description. + // If the template doesn't have one, the existing description + // from the instance shall not be removed. DiagramDesc mdesc = graph.syncRequest(DiagramRequests.getDiagramDesc(template)); + if (mdesc == null) { + info.messageLog.add("\t\ttemplate doesn't have any diagram page settings, doing nothing"); + return false; + } DiagramDesc idesc = graph.syncRequest(DiagramRequests.getDiagramDesc(instance)); if (mdesc.equals(idesc)) return false;