summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2006-02-09 20:01:41 +0000
committerVeronika Irvine <veronika>2006-02-09 20:01:41 +0000
commit32e3be4cf6d4df308bb7ba7131358b236c899b4c (patch)
tree3dacfd6941ade59ecdf7e6608e2ac1d84b8b87f0
parentd61f1c6afcf32ea184f14d914b6a7730549347ac (diff)
downloadeclipse.platform.swt-32e3be4cf6d4df308bb7ba7131358b236c899b4c.tar.gz
eclipse.platform.swt-32e3be4cf6d4df308bb7ba7131358b236c899b4c.tar.xz
eclipse.platform.swt-32e3be4cf6d4df308bb7ba7131358b236c899b4c.zip
Bug 126996 - Same image problem occurs if TreeColumn or TableColumn present
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java14
2 files changed, 12 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 833425884d..84ab3c443e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -908,9 +908,9 @@ public void setImage (int index, Image image) {
}
int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
OS.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_PIXBUF, pixbuf, -1);
- if (image != null && parent.columnCount == 0) {
+ if (image != null) {
int /*long*/parentHandle = parent.handle;
- int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, 0);
+ int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, index);
if (OS.gtk_tree_view_column_get_sizing (column) == OS.GTK_TREE_VIEW_COLUMN_FIXED) {
parent.setScrollWidth (column, this);
/*
@@ -1004,12 +1004,10 @@ public void setText (int index, String string) {
byte[] buffer = Converter.wcsToMbcs (null, string, true);
int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex;
OS.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_TEXT, buffer, -1);
- if (parent.columnCount == 0) {
- int /*long*/parentHandle = parent.handle;
- int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, 0);
- if (OS.gtk_tree_view_column_get_sizing (column) == OS.GTK_TREE_VIEW_COLUMN_FIXED) {
- parent.setScrollWidth (column, this);
- }
+ int /*long*/parentHandle = parent.handle;
+ int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, index);
+ if (OS.gtk_tree_view_column_get_sizing (column) == OS.GTK_TREE_VIEW_COLUMN_FIXED) {
+ parent.setScrollWidth (column, this);
}
cached = true;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index 93716c44ab..ca434b8f33 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -1315,9 +1315,9 @@ public void setImage (int index, Image image) {
}
int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
OS.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_PIXBUF, pixbuf, -1);
- if (image != null && parent.columnCount == 0) {
+ if (image != null) {
int /*long*/parentHandle = parent.handle;
- int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, 0);
+ int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, index);
if (OS.gtk_tree_view_column_get_sizing (column) == OS.GTK_TREE_VIEW_COLUMN_FIXED) {
parent.setScrollWidth (column, this);
/*
@@ -1401,12 +1401,10 @@ public void setText (int index, String string) {
byte[] buffer = Converter.wcsToMbcs (null, string, true);
int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex;
OS.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_TEXT, buffer, -1);
- if (parent.columnCount == 0) {
- int /*long*/parentHandle = parent.handle;
- int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, 0);
- if (OS.gtk_tree_view_column_get_sizing (column) == OS.GTK_TREE_VIEW_COLUMN_FIXED) {
- parent.setScrollWidth (column, this);
- }
+ int /*long*/parentHandle = parent.handle;
+ int /*long*/ column = OS.gtk_tree_view_get_column (parentHandle, index);
+ if (OS.gtk_tree_view_column_get_sizing (column) == OS.GTK_TREE_VIEW_COLUMN_FIXED) {
+ parent.setScrollWidth (column, this);
}
cached = true;
}