Page MenuHomePhabricator

ChangeRequest bug 2428.txt

Authored By
neuhaus
Aug 27 2009, 3:01 PM
Size
1 KB
Referenced Files
None
Subscribers
None

ChangeRequest bug 2428.txt

Summary of bug description
* actual behaviour
invoking the OpMOVEPOINTUP and OpMOVEPOINTDOWN operations on a mitk::Pointset
will lead to a crash, if the point IDs are not consecutive (e.g. 1,2,4)
* expected behaviour
there should be no crash, the next bigger/smaller point ID should be used
Cause of the bug
again the ID of the map container is mistaken for an index. Using arithmical operations
on an ID is invalid. The current implementation did a ID++ / ID-- to determine the
ID of the other element with which to swap the data. If that calculated ID did not exist,
the application crashes.
Proposed solution
Use IDs as IDs. Search the point container for the object preceding/succeeding the one
for which the operation gets executed. If one is found, swap their contents.
Affected classes
mitk::PointSet
How will the bugfix get tested?
1) Manual testing with a bundle that contains a pointlistwidget. F2/F3 can be used there to
execute the OpMOVEPOINTUP and OpMOVEPOINTDOWN operations. ENTF can be used to delete points
to create missing entries in the point IDs.
2) adapt the unit test: add points with IDs 10, 11, 12, remove point with ID 11,
call OpMOVEPOINTUP and OpMOVEPOINTDOWN on 10 and 12, also call OpMOVEPOINTUP on first
and OpMOVEPOINTDOWN on last point

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
289
Default Alt Text
ChangeRequest bug 2428.txt (1 KB)

Event Timeline