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 519162 - C++ code generation mixes up attributes of classes and discards default values
C++ code generation mixes up attributes of classes and discards default values
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: python
0.96.1
Other All
: Normal normal
: 0.97
Assigned To: Hans Breuer
Hans Breuer
Depends on:
Blocks:
 
 
Reported: 2008-02-27 22:25 UTC by David Roth
Modified: 2008-04-06 18:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Roth 2008-02-27 22:25:55 UTC
Please describe the problem:
The C++ code generation module does not respect the order of attributes of UML classes. If UML class C has attributes a,b,c,d,e,f in this order it is unpredictable in which order they will show up in the C++ code. For larger numbers of attributes this makes the code unreadable.

Moreover, default values as in f(x:int = 0):int are discarded.

Steps to reproduce:
1. Create an UML class C.
2. Add attributes a,b,c to C.
3. Add operation f(x:int = 0):int to C.
4. Export to C++.
5. Look at the generated code file.

Actual results:
The code file is generated, but contains unsorted attributes and misses default values for function parameters.

Expected results:
I would expect attributes to show up in exactly the same order I defined them in the class diagram.

Does this happen every time?
Yes.

Other information:
Comment 1 Hans Breuer 2008-04-06 18:39:32 UTC
2008-04-06  Hans Breuer  <hans@breuer.org>

	* plug-ins/python/codegen.py : use a list for attributes rather than
	a dictionary to preserve the order of attributes. Fixes bug #519162