Bug 54816 - associations not pasted after a copy
Summary: associations not pasted after a copy
Status: CLOSED LATER
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: HI normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-18 21:12 UTC by Jonathan Riddell
Modified: 2004-01-05 13:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Riddell 2003-02-18 21:12:33 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Copy and paste two classes (or anything) with an association between them.  The association isn't there when pasted.  (This has something to do with the new UMLAssociation class.)
Comment 1 Oliver Kellogg 2003-09-27 18:07:42 UTC
Resolving this beastie would be much simplified
if AssociationWidgets were UMLWidgets.
(BTW this would also mirror the inheritance of
UMLAssociation which is an UMLObject.)

I am currently looking into this change.
Comment 2 Oliver Kellogg 2003-09-28 00:55:36 UTC
Fixed in CVS.
Please verify.

Sidenote: I ended up not making that change
(to have AssocWidget inherit from UMLWidget.)
Turns out that all the parts were already there,
just some details needed straightening out.
Comment 3 Oliver Kellogg 2003-10-05 23:51:20 UTC
*** Bug has been marked as fixed ***.
Comment 4 Oliver Kellogg 2003-10-06 23:16:56 UTC
Had to reopen this one:
Copy/pasteing seems to work but Cut/paste does not.
This has to do with the UMLAssociation getting removed
by the UMLView::removeAssocInViewAndDoc which is called
by UMLView::removeAssoc in the course of cutting.

I'll investigate whether we can add a flag to removeAssoc
("inCutOperation" or so) that will preserve the
UMLAssociation in the UMLDoc when removeAssoc is called
in the course of a cut. OTOH, this creates the problem
that obsolete UMLAssociations (i.e. UMLAssociations
that have been cut some time, but were never pasted)
never get removed.

IMHO the only real solution is to have a listview
representation for UMLAssociations so that they can be
explicitly removed. (Sounds like major work - I can't
shoulder it just now.)
Comment 5 Oliver Kellogg 2003-10-07 23:35:19 UTC
Here's the current solution:

The UMLView does not normally remove UMLAssociations
(i.e. UMLView::removeAssoc() no longer calls removeAssocInViewAndDoc().)

There are only two ways of removing them:
1. Right click on the assocwidget in the view and select Delete
2. Go to the Class Properties page, select Associations, right click
   on the association description and select Delete

Comment 6 Oliver Kellogg 2003-12-26 20:03:02 UTC
Brian's reference counting of UMLAssociation has broken cut/paste.
I guess we still need to think about this one.
Comment 7 Oliver Kellogg 2003-12-31 15:44:49 UTC
Fixes are forthcoming for this problem as well as
the following others:
- namespace/package nesting of imported code
- generation of UMLEnums from enums in imported code
- generalizations existing as AssocWidgets, but not as UMLAssociations

I probably won't be able to check in these fixes before Jan.4.
Comment 8 Oliver Kellogg 2004-01-05 13:59:23 UTC
Brian,
In AssociationWidget::setUMLAssociation(), I again
had to take out the

  if (m_pAssociation->nrof_parent_widgets == 0)
    m_pAssociation->deleteLater();

Does this cause a problem for you?
If so then please raise a separate PR at bugs.kde.org.
Thanks,
 Oliver