Bug 103934 - Table.getItem(Point) uses incorrect calculation on Motif
Summary: Table.getItem(Point) uses incorrect calculation on Motif
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: All Unix All
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Grant Gayed CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-14 19:50 EDT by Mitch Rudominer CLA Friend
Modified: 2005-08-08 15:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mitch Rudominer CLA Friend 2005-07-14 19:50:04 EDT
In all Motif versions of SWT, the method Table.getItem(Point) does not work
correctly if the index of the top item of the table is anything other than 
zero. Thus it does not work correctly if the table is scrolled down. The method 
will almost always return null. The bug is in the line:
int index = (point.y - getHeaderHeight ()) / itemHeight - topIndex;
The final minus sign should be a plus sign. The line should instead read:
int index = (point.y - getHeaderHeight ()) / itemHeight + topIndex;

The method works correctly on Windows. I have not tried GTK.
Comment 1 Grant Gayed CLA Friend 2005-07-18 14:36:21 EDT
Fixed > 0718 in the motif/photon Table and Tree.

Thanks for investigating the cause; I've added you to the contributors list.

This seems like a candidate fix for 3.1.1.
Comment 2 Grant Gayed CLA Friend 2005-08-08 15:48:23 EDT
committed changes to the 3.1.1 stream as well