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

Bug 355323

Summary: Table columns in Snippet77 not properly sized
Product: [Eclipse Project] Platform Reporter: Michal Molhanec <molsoft>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: trivial    
Priority: P3    
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Michal Molhanec CLA 2011-08-21 13:56:57 EDT
Build Identifier: 

The table's 2 columns used to fill complete area of the table. Since last change to this snippet it is not true anymore, there is empty 3rd column of 2*vertical_scrollbar_width.

Simple patch:
The line
int width = area.width - table.computeTrim(0,0,0,0).width - vBar.getSize().x;
should probably be
int width = area.width - table.computeTrim(0,0,0,0).width + vBar.getSize().x;
(better would be to leave out vBar.getSize().x here and reverse the condition and -= to += below).

What IMHO happened: the code was rewritten from using getBorderWidth() to computeTrim() however as the table is created with SWT.V_SCROLL the computeTrim already leaves space for vertical scrollbar so it is not needed to substract its width anymore.

The diff of the last change to the snippet:
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/diff/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet77.java?id=c7803a0f46f80d1a4ac46cdccc2dc58fce4a99b7

Reproducible: Always

Steps to Reproduce:
1. Run Snippet77
2.
3.
Comment 1 Lars Vogel CLA 2019-11-14 03:40:39 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.
Comment 2 Alexander Kurtakov CLA 2020-01-15 08:46:34 EST
Nothing happend in years and snippet is sane enough. CLosing.