In class AssociationWidget change member m_associationLine to value instead of pointer:
umbrello/umlwidgets/associationwidget.h - Add #include "associationline.h". - Remove forward declaraction of class AssociationLine. - Replace accessor AssociationLine* associationLine() const by the two accessors const AssociationLine& associationLine() const; AssociationLine& associationLine(). - Omit pointer "*" at declaration of private member m_associationLine. umbrello/umlwidgets/associationwidget.cpp - Align code to the above changes. Functions affected: AssociationWidget(UMLScene*), create(UMLScene*, UMLWidget*, Uml::AssociationType::Enum, UMLWidget*), ~AssociationWidget, calculateNameTextSegment, operator=, associationLine, cleanup, isPointAddable, isPointRemovable, isAutoLayouted, setAssociationType, moveEvent, calculateEndingPoints, doUpdates, createPointsSelfAssociation, updatePointsSelfAssociation, createPointsException, updatePointsException, calculateTextPosition, constrainTextPos, computeAssocClassLine, mousePressEvent, mouseReleaseEvent, slotMenuSelection, setTextColor, setLineWidth, checkAddPoint, checkRemovePoint, checkAutoLayoutSpline, mouseMoveEvent, intersect, updateAssociations, updateRegionLineCount, setSelected, onAssociation, setXEntireAssoc, setYEntireAssoc, moveMidPointsBy, moveEntireAssoc, boundingRect, contextMenuEvent, hoverEnterEvent, hoverLeaveEvent, saveToXMI, loadFromXMI. - In destructor remove call to cleanup(). Reason: cleanup() calls updateAssociations() which iterates over m_scene->associationList() which may in turn access association widgets that have already been deconstructed, resulting in crash. - In function setUMLObject remove TODO comment about "It is not clear that we need associations to InstanceAttribute" and its attached code. Reason: InstanceAttribute is no longer a UMLClassifierListItem. - Clean up documentation in functions calculateNameTextSegment, isPointAddable, isPointRemovable. - In function linePathStartsAt remove TODO and activate its commented code such that it produces a local bool result1 as the result. Temporarily logical-OR result with result1 (subject to change). - In function doUpdates declaration of `region' restore reference, i.e. change Uml::Region::Enum to Uml::Region::Enum&. Reason: `region' shall act as a writable alias for m_role[role].m_WidgetRegion. The reference had been lost in commit bf937e26 (2013-07-26). umbrello/dialogs/pages/umlwidgetstylepage.cpp - Adjust functions init(), apply() to changed signature of AssociationWidget::associationLine(). umbrello/layoutgenerator.cpp - Adjust function apply() to changed signature of AssociationWidget::associationLine(). umbrello/menus/associationwidgetpopupmenu.{h,cpp} - Adjust function insertSubMenuLayout to changed signature of AssociationWidget::associationLine(). umbrello/toolbarstateassociation.cpp - Adjust functions mouseReleaseAssociation, setSecondWidget to changed signature of AssociationWidget::associationLine(). umbrello/umlwidgets/classifierwidget.cpp - Adjust function drawAsCircle to changed signature of AssociationWidget::associationLine().
Please register or sign in to comment