achuanle / umlet

Automatically exported from code.google.com/p/umlet
0 stars 0 forks source link

diagram help_text can overwrite element text of other diagram #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add any element to diagram, change diagram help_text to "mycomment", save 
diagram, close diagram
2. insert any element (eg SimpleClass) to another new diagram, and select the 
SimpleClass element
3. open the previously stored diagram (eg using the "Recent files" menu)
4. switch back to first tab with non-saved diagram

What is the expected output? What do you see instead?
Expected: non-saved diagram has not changed, SimpleClass is still selected and 
property panel has content of SimpleClass
Instead: the SimpleClass element content was overwritten by the help_text 
"mycomment" of the stored diagram

Original issue reported on code.google.com by AFDiaX on 24 Mar 2014 at 8:15

GoogleCodeExporter commented 9 years ago
fixed in r963

basically the problem is that the field editedGridElement (stored in Main.java) 
represents the currently edited element (used eg by property panel change 
listeners to update the element with the changed text)
the call "DiagramHandler diagram = new DiagramHandler(file);" triggers a 
propertypanel change event which propagates the changes to the editedGridElement
2 lines later "this.gui.open(diagram);" resets "editedGridElement" to null, but 
the change has already happened.

The quick fix is setting "editedGridElement = null;" before creating the 
DiagramHandler to make sure the selected element will not be changed by the 
open-command

Original comment by AFDiaX on 24 Mar 2014 at 8:23

GoogleCodeExporter commented 9 years ago

Original comment by AFDiaX on 3 May 2014 at 11:11