From 602755ff0bc975d84d5fb8e8a983c49526950a93 Mon Sep 17 00:00:00 2001 From: lclausen Date: Thu, 29 Sep 2005 12:43:31 +0000 Subject: [PATCH] Mainpoint-related fixes, not fixed conn bug yet. --- .cvsignore | 2 ++ ChangeLog | 7 +++++++ objects/UML/class.c | 21 +++++++++++---------- objects/UML/class.h | 2 ++ objects/UML/umlattribute.c | 2 -- objects/UML/umloperation.c | 3 +-- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.cvsignore b/.cvsignore index fa9f5202..a53c668a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,5 @@ +*.lo +.libs .deps stamp-h* Makefile diff --git a/ChangeLog b/ChangeLog index 7557d68c..417c8eee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-09-29 Lars Clausen + + * objects/UML/class.h: Enabling mainpoints for UML. + + * objects/UML/class.c (umlclass_set_props): Make sure to always + realloc connection point list. + 2005-09-26 Ahmad Riza H Nst * configure.in: Added "id" in ALL_LINGUAS line. diff --git a/objects/UML/class.c b/objects/UML/class.c index b8955b65..aa9e78f8 100644 --- a/objects/UML/class.c +++ b/objects/UML/class.c @@ -316,19 +316,20 @@ umlclass_set_props(UMLClass *umlclass, GPtrArray *props) props); num = UMLCLASS_CONNECTIONPOINTS + umlclass_num_dynamic_connectionpoints(umlclass); +#ifdef UML_MAINPOINT + obj->num_connections = num + 1; +#else + obj->num_connections = num; +#endif + obj->connections = g_realloc(obj->connections, obj->num_connections*sizeof(ConnectionPoint *)); + /* Update data: */ if (num > UMLCLASS_CONNECTIONPOINTS) { int i; /* this is just updating pointers to ConnectionPoint, the real connection handling is elsewhere. * Note: Can't optimize here on number change cause the ops/attribs may have changed regardless of that. */ -#ifdef UML_MAINPOINT - obj->num_connections = num + 1; -#else - obj->num_connections = num; -#endif i = UMLCLASS_CONNECTIONPOINTS; - obj->connections = g_realloc(obj->connections, obj->num_connections*sizeof(ConnectionPoint *)); list = (!umlclass->visible_attributes || umlclass->suppress_attributes) ? NULL : umlclass->attributes; while (list != NULL) { UMLAttribute *attr = (UMLAttribute *)list->data; @@ -352,12 +353,12 @@ umlclass_set_props(UMLClass *umlclass, GPtrArray *props) i++; list = g_list_next(list); } + } #ifdef UML_MAINPOINT - obj->connections[i] = ¨class->connections[UMLCLASS_CONNECTIONPOINTS]; - obj->connections[i]->object = obj; - i++; + obj->connections[num] = ¨class->connections[UMLCLASS_CONNECTIONPOINTS]; + obj->connections[num]->object = obj; #endif - } + umlclass_calculate_data(umlclass); umlclass_update_data(umlclass); } diff --git a/objects/UML/class.h b/objects/UML/class.h index c3867ab8..dac34a52 100644 --- a/objects/UML/class.h +++ b/objects/UML/class.h @@ -35,6 +35,8 @@ * operation changes) is taken into account. It probably has other issues we are * not aware of yet. Some more information maybe available at * http://bugzilla.gnome.org/show_bug.cgi?id=303301 + * + * Enabling 29/7 2005: Not known to cause any problems. */ #define UML_MAINPOINT 1 diff --git a/objects/UML/umlattribute.c b/objects/UML/umlattribute.c index 0a2a0a9e..4c889740 100644 --- a/objects/UML/umlattribute.c +++ b/objects/UML/umlattribute.c @@ -131,9 +131,7 @@ uml_attribute_destroy(UMLAttribute *attr) g_free(attr->value); if (attr->comment != NULL) g_free(attr->comment); - object_remove_connections_to(attr->left_connection); g_free(attr->left_connection); - object_remove_connections_to(attr->right_connection); g_free(attr->right_connection); g_free(attr); } diff --git a/objects/UML/umloperation.c b/objects/UML/umloperation.c index 42767217..35d5f972 100644 --- a/objects/UML/umloperation.c +++ b/objects/UML/umloperation.c @@ -202,9 +202,8 @@ uml_operation_destroy(UMLOperation *op) uml_parameter_destroy(param); list = g_list_next(list); } - object_remove_connections_to(op->left_connection); + /* These are merely temporary reminders, don't need to unconnect */ g_free(op->left_connection); - object_remove_connections_to(op->right_connection); g_free(op->right_connection); g_free(op); } -- 2.11.4.GIT