[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Nov 1 02:44:06 UTC 2003
CVS commit by okellogg:
Fix bug 65389.
M +25 -13 associationwidget.cpp 1.67
--- kdesdk/umbrello/umbrello/associationwidget.cpp #1.66:1.67
@@ -980,21 +980,33 @@ Association_Type AssociationWidget::getA
/** Sets the association's type */
void AssociationWidget::setAssocType(Association_Type type) {
- //if the association new type is not supposed to have Multiplicity FloatingTexts and a Role
- //FloatingText then set the internl floating text pointers to null
- if( !AssocRules::allowMultiplicity( type, getWidgetA() -> getBaseType() ) ) {
- setMultiA( 0 ); setMultiA("");
- setMultiB( 0 ); setMultiB("");
- }
- if( !AssocRules::allowRole( type ) )
- {
- setRoleNameA("");
- setRoleADoc("");
- setRoleNameB("");
- setRoleBDoc("");
- }
if (m_pAssociation)
m_pAssociation->setAssocType(type);
m_AssocType = type;
m_LinePath.setAssocType(type);
+ // If the association new type is not supposed to have Multiplicity
+ // FloatingTexts and a Role FloatingText then set the internal
+ // floating text pointers to null.
+ if( !AssocRules::allowMultiplicity(type, getWidgetA()->getBaseType()) ) {
+ if (m_pMultiA) {
+ delete m_pMultiA;
+ m_pMultiA = NULL;
+ }
+ if (m_pMultiB) {
+ delete m_pMultiB;
+ m_pMultiB = NULL;
+ }
+ }
+ if( !AssocRules::allowRole( type ) ) {
+ if (m_pRoleA) {
+ delete m_pRoleA;
+ m_pRoleA = NULL;
+ }
+ if (m_pRoleB) {
+ delete m_pRoleB;
+ m_pRoleB = NULL;
+ }
+ setRoleADoc("");
+ setRoleBDoc("");
+ }
}
More information about the umbrello-devel
mailing list