Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 545437

Summary: Enabling AutoHeight for GridVierwer leads to IllegalArgumentException
Product: [RT] RAP Reporter: Linuxhippy <linuxhippy>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.8   
Target Milestone: 3.10   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/145847
https://git.eclipse.org/c/rap/org.eclipse.rap.git/commit/?id=5a4dce11c277f9cef53970f10916294f428a5003
Whiteboard:
Attachments:
Description Flags
self-contained test case none

Description Linuxhippy CLA 2019-03-15 06:55:13 EDT
Enabling AutoHeight can result in bogus index calculations when scrolling, which result in the following IllegalArgumentException (start=1 passed to getRowRange, although table only has a single element):

java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:3694)
	at org.eclipse.swt.SWT.error(SWT.java:3631)
	at org.eclipse.swt.SWT.error(SWT.java:3602)
	at org.eclipse.nebula.widgets.grid.Grid.getRowRange(Grid.java:3081)
	at org.eclipse.nebula.widgets.grid.Grid.getBottomIndex(Grid.java:2509)
	at org.eclipse.nebula.widgets.grid.Grid.isShown(Grid.java:2557)
	at org.eclipse.nebula.widgets.grid.GridItem.getBounds(GridItem.java:1341)
	at org.eclipse.nebula.widgets.grid.GridEditor.computeBounds(GridEditor.java:171)
	at org.eclipse.nebula.widgets.grid.GridEditor.layout(GridEditor.java:391)
	at org.eclipse.swt.custom.ControlEditor.scroll(ControlEditor.java:241)
	at org.eclipse.swt.custom.ControlEditor$2.handleEvent(ControlEditor.java:136)
Comment 1 Linuxhippy CLA 2019-03-15 06:58:47 EDT
Created attachment 277880 [details]
self-contained test case
Comment 2 Linuxhippy CLA 2019-03-15 06:59:39 EDT
please have a look at the self-contained test-case.

Using the scroll-wheel inside the TableViewer results in the IllegalArgumentException.
Comment 3 Ivan Furnadjiev CLA 2019-03-28 04:43:25 EDT
Thanks for the snippet
Comment 4 Ivan Furnadjiev CLA 2019-03-28 05:24:50 EDT
Clemens, is it reproducible with plain Grid without GridTableViewer?
Comment 5 Eclipse Genie CLA 2019-07-10 07:12:09 EDT
New Gerrit change created: https://git.eclipse.org/r/145847