Bug 372579 - Delete attributes or operations in classes
Summary: Delete attributes or operations in classes
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.20.1 (KDE Applications 16.08.1)
Platform: Other All
: NOR major
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-17 10:59 UTC by abel123
Modified: 2016-11-18 07:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.20.80 (KDE Applications 16.11.80)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description abel123 2016-11-17 10:59:10 UTC
In the class diagram, sometimes the delete doesn't work for attributes or operations in a class. It deletes it in the list but not in the diagram and then doesn't the delete the attribute/operation.
Reopening the file seems to solve it temporarily. After some time of doing this, the app just crashed without warning.

Version: 2.20.3
Comment 1 abel123 2016-11-17 11:03:22 UTC
To reproduce this behaviour try creating a class/interface with several (5 or 6) attributes/operations and then copy it and duplicate it. Then change the duplicated or copied class by deleting attributes or operations.
Comment 2 Ralf Habacker 2016-11-17 11:51:26 UTC
This issue is caused by a bug in the duplicate function. On ListPopupMenu::mt_Clone event a new cloned UMLObject is created and the UMLObject dock window in umbrello build from git master shows that new attributes are created but are still assigned to the old class.
Comment 3 Ralf Habacker 2016-11-17 11:59:23 UTC
The related location where it fails is shown below:

/**
 * Make a clone of the UMLAttribute.
 */
UMLObject* UMLAttribute::clone() const
{
    //FIXME: The new attribute should be slaved to the NEW parent not the old.
    UMLAttribute *clone = new UMLAttribute(umlParent());
    copyInto(clone);

    return clone;
}
Comment 4 Ralf Habacker 2016-11-18 07:41:17 UTC
Git commit a86130613067940d27c98f6f845037817c705297 by Ralf Habacker.
Committed on 17/11/2016 at 23:41.
Pushed by habacker into branch 'Applications/16.12'.

Fix 'Delete attributes or operations in classes'.
FIXED-IN:2.20.80 (KDE Applications 16.11.80)

M  +4    -0    umbrello/umlmodel/classifier.cpp

http://commits.kde.org/umbrello/a86130613067940d27c98f6f845037817c705297