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

Bug 318589

Summary: setting an image in a table column creates an indent for the text in the first column
Product: [Eclipse Project] Platform Reporter: Bogdan Dumitriu <bdumitriu>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Bogdan Dumitriu CLA 2010-07-01 08:11:57 EDT
Build Identifier: 20100617-1415

Run the following snippet:

public class Snippet {

	public static void main(String[] args) {
		Display display = new Display();
		final Image image = display.getSystemImage(SWT.ICON_INFORMATION);
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());

		Table table = new Table(shell, SWT.NONE);
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		TableColumn column1 = new TableColumn(table, SWT.NONE);
		column1.setText("Column 1");
		TableColumn column2 = new TableColumn(table, SWT.NONE);
		column2.setText("Column 2");
		TableItem item = new TableItem(table, SWT.NONE);
		item.setText(0, "row 1");
		item.setImage(1, image);
		column1.pack();
		column2.pack();

		shell.setSize(500, 200);
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		if (image != null) {
			image.dispose();
		}
		display.dispose();
	}
}

Note that the text in the first column is wrongly indented with an indent the size of the image. There is no indent if no image is set.

Reproducible: Always

Steps to Reproduce:
1. Run the snippet.
Comment 1 Bogdan Dumitriu CLA 2010-07-01 08:13:19 EDT
Sorry about the missing import section for the snippet. Here it is:

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:04:13 EDT
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.
Comment 3 Eclipse Genie CLA 2021-12-22 17:50:33 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.