Bug 92116 - off-by-one bug with moving list items in Umbrello
Summary: off-by-one bug with moving list items in Umbrello
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: FreeBSD Ports FreeBSD
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-26 09:01 UTC by Stefan Walter
Modified: 2004-10-26 20:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Walter 2004-10-26 09:01:33 UTC
Version:            (using KDE KDE 3.3.0)
Installed from:    FreeBSD Ports
Compiler:          gcc 3.4.2 
OS:                FreeBSD

When changing the order of operations or attributes of a class, using the
dialog's down button changes the order of items in the dialog list correctly,
but moves the item in the class itself down two slots (i.e. one too far).

Create a class with attributes and/or operations, then double-click on the
class to open its properties dialog. Choose 'operations' or 'attributes'.
Choose one of the attributes/operations and click on the 'down' arrow. The
chosen item will be moved down by one in the list, but two in the diagram.

The following patch fixes Umbrello's behaviour:

--- umbrello/umbrello/dialogs/classifierlistpage.cpp.old	Mon Oct 25 16:09:31 2004
+++ umbrello/umbrello/dialogs/classifierlistpage.cpp	Mon Oct 25 16:09:56 2004
@@ -348,7 +348,7 @@
 	//now change around in the list
 	UMLClassifierListItem* currentAtt = getItemList().at( index );
 	takeClassifier(currentAtt);
-	addClassifier(currentAtt, index + 2);
+	addClassifier(currentAtt, index + 1);
 	slotClicked( item );
 }
Comment 1 Oliver Kellogg 2004-10-26 20:15:02 UTC
Ah, the kind of bug I like - self fixing :)
Thanks for the patch.