Bug 54575

Summary: association anchor points not saved
Product: [Applications] umbrello Reporter: Eustáquio Rangel de Oliveira Jr. <eustaquiorangel>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal CC: jr, mirko-lists
Priority: HI    
Version: 1.1.1   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Eustáquio Rangel de Oliveira Jr. 2003-02-12 22:36:41 UTC
Version:           1.1.1 (using KDE KDE 3.1)
Installed from:    RedHat RPMs
OS:          Linux

When saving the file, the association anchor points, changed to improve the visibility of your diagram, are not saved on their current positions.
When opening the file again, they are just lines without the points.
Comment 1 Chris Gordon-Smith 2003-03-22 14:53:06 UTC
Umbrello is an excellent and much needed program for KDE. However, while it has
this problem I cannot use it. Once it is fixed, it will make sense for me to
transfer the design of my artificial chemistry simulator to Umbrello.
Comment 2 Robert Lowe 2003-04-14 21:53:02 UTC
I'm experiencing this bug too.  i just now lost a lot of points I had put into
an activity diagram.  I really can't use this for my more complex models until
this is resolved.
Comment 3 Robert Lowe 2003-04-17 20:07:34 UTC
Actually, upon further inspection, it appears that umbrello is saving the points
correctly, it is just not reading them in.  I think I'll delve into the code a
bit and see if I can make it work.

Just keep looking on the file opening routines, its in there (or rather in this
case it isn't).
Comment 4 Carsten Pfeiffer 2003-04-18 15:05:27 UTC
Subject: Re: [Uml-devel]  association anchor points not saved

On Thursday 17 April 2003 20:07, Robert Lowe wrote:

> Actually, upon further inspection, it appears that umbrello is saving the
> points correctly, it is just not reading them in.  I think I'll delve into
> the code a bit and see if I can make it work.
>
> Just keep looking on the file opening routines, its in there (or rather in
> this case it isn't).

There is a bugreport about that already, with an explanation of the problem. 
Sorry, don't have the bugnumber handy and not the time to fix this :-/

Cheers
Carsten Pfeiffer
-----BEGIN PGP SIGNATURE-----

iQEVAwUBPp/3o6WgYMJuwmZtAQHMsAf9FWH2nXvhpRjM29fM/jXx6/sd1K+TLJMT
vD0DOt8ppMs1SWeeQxYl4swEv+Y73ZgYoRnymmYrMcmdPtyTbt3HEoz7+hB7IsQB
Q4pXnQcQaQD4/5CG5Gte0mowQTAVLXfX5UBPjHzhhQEU3pgQOF59IC+/fspzCunX
odHTSKwLHEYp4FDjqQQSC9ItGo72A0vC4cViltkR8MoDXMZ8B/KJFpnwegej91Z7
P9p43eWETJ2As71y903YDpoLZuxMk8N+y+OaRZZ6nNziNP6MsYJBn2ua8WNxoqTp
LfSl78EwSaK0cZoTD9jy695bbN87oyv3WQHqSSVa3itsUdFWY7Si8w==
=id3Q
-----END PGP SIGNATURE-----

Comment 5 Luis Carvalho 2003-05-06 21:27:41 UTC
I believe the bug 54817 is a duplicate of this one.
Comment 6 Luis Carvalho 2003-05-06 21:34:31 UTC
Also the bug Carsten mentions is 54573.
Another bug that is may be a duplicate of this one is 53447.
Comment 7 Jonathan Riddell 2003-05-06 21:51:56 UTC
*** Bug 54817 has been marked as a duplicate of this bug. ***
Comment 8 Jonathan Riddell 2003-05-06 21:53:25 UTC
*** Bug 53447 has been marked as a duplicate of this bug. ***
Comment 9 Oliver Kellogg 2003-05-09 18:14:31 UTC
Anybody already working on this one?
If not, I will give it a try.

--Oliver
Comment 10 Jonathan Riddell 2003-05-09 18:56:12 UTC
Go for it Oliver.
Comment 11 Oliver Kellogg 2003-05-10 11:41:53 UTC
First of all, I had to do this:

*** /dosc/kdesdk/umbrello/umbrello/linepath.cpp	Sat Mar 29 22:44:50 2003
--- ./linepath.cpp	Sat May 10 21:20:39 2003
***************
*** 44,49 ****
--- 44,51 ----
  void LinePath::setAssociation(AssociationWidget * association ) {
  	if( !association )
  		return;
+ 	if (m_pAssociation)
+ 		m_LineList.clear();
  	m_pAssociation = association;
  	cleanup();
  	createHeadLines();
***************
*** 777,783 ****
  }
  
  void LinePath::cleanup() {
- 	m_LineList.clear();
  	m_HeadList.clear();
  	m_RectList.clear();
  	m_ParallelList.clear();


because the points read in from linePath::loadFromXMI()
where being wiped out right afterwards by the LinePath::
setAssociation call from the AssociationWidget::init().

But having applied that diff, I get no more association
(that has an anchor point) drawn at all !
I don't understand why.
The data would seem to be okay; at least the AssociationWidget's
m_pData->m_LinePath has the anchor points.
Perhaps it has something to do with the AssociationWidget::
calculateEndingPoints().

I'm not an expert here; your ideas are most welcome.

--Oliver
Comment 12 Jonathan Riddell 2003-05-16 23:26:59 UTC
I've looked at it and I'm stuck too.

> because the points read in from linePath::loadFromXMI()
> where being wiped out right afterwards by the LinePath::
> setAssociation call from the AssociationWidget::init(). 

actually that is called on an unused linepath (from an unused
associationwidetdata)  the correct associationWidgetData is set in setData(),
which then calls setAssociation and wipes out linePath's points.  I've no idea
why not calling m_LineList.clear() causes the association to not be displayed at
all (the widget is still there internally though).
Comment 13 Eustáquio Rangel de Oliveira Jr. 2003-05-16 23:27:41 UTC
Subject: Yahoo! Auto Response

Ol
Comment 14 Oliver Kellogg 2003-05-18 15:08:25 UTC
FWIW, my AssociationWidgetData => AssociationWidget merge
has not brought any relief.

This brings up a debugging related question:
Is there a way to inspect what's on the canvas
(before tha canvas has been physically drawn) ?

--Oliver

Comment 15 Jonathan Riddell 2003-05-21 02:08:23 UTC
> Is there a way to inspect what's on the canvas
> (before tha canvas has been physically drawn) ? 

I don't think so.
Comment 16 Oliver Kellogg 2003-05-22 07:00:25 UTC
At the time of LinePath::loadFromXMI(), the m_pAssociation does
not yet exist. This means that the "new QCanvasLine" created in
LinePath::insertPoint has a null parent.  I.e. the general order
in which things are created is not right.

Now, any ideas on the Right Way to fix this?
Comment 17 Oliver Kellogg 2003-05-23 06:27:35 UTC
Fixed as per my checkin of yesterday (2003-05-22.)

Here's what I did: Added a method activate() to class LinePath
that will re-create the lines in m_LineList. At the time of the
activate() call, the m_pAssociation does exist, thus the parent
of the lines gets set to the canvas properly.

--Oliver
Comment 18 Jonathan Riddell 2003-05-27 13:08:12 UTC
Yo do man Oliver.  Looks fixed to me.