Bug 160498

Summary: Need the Tracker class to accept empty Rectangle lists
Product: [Eclipse Project] Platform Reporter: Eric Moffatt <emoffatt>
Component: SWTAssignee: Steve Northover <steve_northover>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Eric Moffatt CLA 2006-10-11 11:45:36 EDT
Steve, here's a more specific defect than bug 155680. Please allow me me to remove the hack that I'm currently using in my trim dragging code (i.e. to set the rectange to (100000,0,0,0) by allowing me to do a setRectangles to an empty array without getting IndexOutOfBounds exceptions.

Here's the test code yo sent me...
	
public static void main (String [] args) {
	Display display = new Display ();
	final Shell shell = new Shell (display);
	shell.addListener (SWT.MouseDown, new Listener (){
		public void handleEvent (Event event) {
			Tracker tracker = new Tracker (shell, SWT.NULL);
			System.out.println("Rectangles=" + tracker.getRectangles());
			tracker.setRectangles(new Rectangle [0]);
			System.out.println("Result=" + tracker.open ());
		}
	});
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
Comment 1 Steve Northover CLA 2006-10-11 13:42:14 EDT
... or not to set the rectangle at all.  This didn't work should.
Comment 2 Steve Northover CLA 2006-10-11 13:48:34 EDT
Fixed > 2006101
Comment 3 Eric Moffatt CLA 2006-10-12 09:39:09 EDT
Thanks Steve...I'll check it out soon.