From: <mcu...@us...> - 2014-04-16 22:06:58
|
Revision: 1543 http://sourceforge.net/p/orm/code/1543 Author: mcurland Date: 2014-04-16 22:06:52 +0000 (Wed, 16 Apr 2014) Log Message: ----------- Fix assertion drawing 1-1 link fact type shape, broken by selection changes in 1539. Modified Paths: -------------- trunk/ORMModel/ShapeModel/FactTypeShape.cs Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2014-04-16 22:05:24 UTC (rev 1542) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2014-04-16 22:06:52 UTC (rev 1543) @@ -1999,7 +1999,14 @@ { if (selection != null) { - FactSetConstraint constraintLink = FactSetConstraint.GetLink((UniquenessConstraint)constraintElement, factType ?? factShape.AssociatedFactType); + UniquenessConstraint uc = (UniquenessConstraint)constraintElement; + FactSetConstraint constraintLink = FactSetConstraint.GetLink(uc, factType ?? (factType = factShape.AssociatedFactType)); + Objectification objectification; + if (constraintLink == null && + null != (objectification = factType.ImpliedByObjectification)) + { + constraintLink = FactSetConstraint.GetLink(uc, objectification.NestedFactType); + } if (testSubField == null) { testSubField = new ConstraintSubField(constraintLink); @@ -5780,7 +5787,17 @@ public DiagramItem GetDiagramItem(UniquenessConstraint constraint) { Debug.Assert(constraint.IsInternal); - return new DiagramItem(this, InternalConstraintShapeField, new ConstraintSubField(FactSetConstraint.GetLink(constraint, AssociatedFactType))); + FactType factType = AssociatedFactType; + FactSetConstraint constraintLink; + if (null == (constraintLink = FactSetConstraint.GetLink(constraint, factType))) + { + Objectification objectification; + if (null != (objectification = factType.ImpliedByObjectification)) + { + constraintLink = FactSetConstraint.GetLink(constraint, factType); + } + } + return new DiagramItem(this, InternalConstraintShapeField, new ConstraintSubField(constraintLink)); } /// <summary> /// Get a diagram item for a role on the associated fact. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |