GNOME Bugzilla – Bug 350272
Duplcated (by Ctrl+D) UML class has turned over attributes and operations
Last modified: 2006-08-07 21:47:06 UTC
Please describe the problem: When I duplcate (by Ctrl+D) UML class copy has turned over attributes and operations. Steps to reproduce: 1. run dia 2. create diagram 3. create UML class 4. fill-in attributes (2 or more) 5. close property sheet 6. select class 7. press Ctrl+D Actual results: Attributes in copy have reverse order Expected results: But I expect direct order Does this happen every time? Yes Other information: Same bug (and cure) for operations and formal_params: In file dia-0.95/objects/UML/class.c In function umlclass_copy(UMLClass *umlclass) I see: newumlclass->attributes = NULL; list = umlclass->attributes; while (list != NULL) { UMLAttribute *attr = (UMLAttribute *)list->data; /* not copying the connection, if there was one */ UMLAttribute *newattr = uml_attribute_copy(attr); uml_attribute_ensure_connection_points (newattr, newobj); newumlclass->attributes = g_list_prepend(newumlclass->attributes, newattr); list = g_list_next(list); } It is mean that list of attributes will be reversed. For right order of items we need not newumlclass->attributes = g_list_prepend(newumlclass->attributes, but newumlclass->attributes = g_list_append(newumlclass->attributes, As well for operations and formal_params.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 342902 ***