After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350272 - Duplcated (by Ctrl+D) UML class has turned over attributes and operations
Duplcated (by Ctrl+D) UML class has turned over attributes and operations
Status: RESOLVED DUPLICATE of bug 342902
Product: dia
Classification: Other
Component: objects
0.95.1
Other All
: Normal minor
: ---
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-07 13:31 UTC by Vadim Zelenin
Modified: 2006-08-07 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vadim Zelenin 2006-08-07 13:31:47 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.
Comment 1 Hans Breuer 2006-08-07 21:47:06 UTC
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 ***