Bug 159597 [Viewers] getRowPart(Point) behaves differently on Table than on Tree
getRowPart(Point) is reacting different between on TableViewer and TreeViewer: TableViewer: ------------ protected Item getItem(int x, int y) { return table.getItem(new Point(x, y)); } TreeViewer: ----------- protected Item getItem(int x, int y) { return getTree().getItem(getTree().toControl(new Point(x, y))); }
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java
protected int indexForElement(Object element) {
		ViewerComparator comparator = getComparator();
		if (comparator == null) {
			return table.getItemCount();
		}
		int count = table.getItemCount();
		int min = 0, max = count - 1;
		while (min <= max) {
			int mid = (min + max) / 2;
			Object data = table.getItem(mid).getData();
			int compare = comparator.compare(this, data, element);
			if (compare == 0) {
				
				while (compare == 0) {
					++mid;
					if (mid >= count) {
						break;
					}
					data = table.getItem(mid).getData();
					compare = comparator.compare(this, data, element);
				}
				return mid;
			}
			if (compare < 0) {
				min = mid + 1;
			} else {
				max = mid - 1;
			}
		}
		return min;