diff options
author | Grant Gayed <grant_gayed@ca.ibm.com> | 2012-09-06 05:50:37 -0400 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2012-09-06 05:51:15 -0400 |
commit | 001a26d56e2c5f6288db0d3f1cb8c5f85fea05dc (patch) | |
tree | 2b5c32b677eaf12d431feb75c07e08c1d9d3d292 | |
parent | 5f9227865b107d4c75700ae0f3a291ce497e659a (diff) | |
download | eclipse.platform.swt-001a26d56e2c5f6288db0d3f1cb8c5f85fea05dc.tar.gz eclipse.platform.swt-001a26d56e2c5f6288db0d3f1cb8c5f85fea05dc.tar.xz eclipse.platform.swt-001a26d56e2c5f6288db0d3f1cb8c5f85fea05dc.zip |
Bug 381407 - reproducible crash in Debug's Variables view (ppc64)
4 files changed, 29 insertions, 21 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index 3aca800842..58ea05420f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -519,12 +519,12 @@ void createColumn (TableColumn column, int index) { TableItem item = items [i]; if (item != null) { int /*long*/ oldItem = item.handle; - /* the first three columns contain int values, subsequent columns contain pointers */ - for (int j=0; j<3; j++) { + /* the columns before FOREGROUND_COLUMN contain int values, subsequent columns contain pointers */ + for (int j=0; j<FOREGROUND_COLUMN; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr1, -1); OS.gtk_list_store_set (newModel, newItem, j, ptr1 [0], -1); } - for (int j=3; j<modelLength; j++) { + for (int j=FOREGROUND_COLUMN; j<modelLength; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1); OS.gtk_list_store_set (newModel, newItem, j, ptr [0], -1); if (types [j] == OS.G_TYPE_STRING ()) { @@ -962,12 +962,12 @@ void destroyItem (TableColumn column) { TableItem item = items [i]; if (item != null) { int /*long*/ oldItem = item.handle; - /* the first three columns contain int values, subsequent columns contain pointers */ - for (int j=0; j<3; j++) { + /* the columns before FOREGROUND_COLUMN contain int values, subsequent columns contain pointers */ + for (int j=0; j<FOREGROUND_COLUMN; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr1, -1); OS.gtk_list_store_set (newModel, newItem, j, ptr1 [0], -1); } - for (int j=3; j<FIRST_COLUMN; j++) { + for (int j=FOREGROUND_COLUMN; j<FIRST_COLUMN; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1); OS.gtk_list_store_set (newModel, newItem, j, ptr [0], -1); if (ptr [0] != 0) { @@ -1009,11 +1009,11 @@ void destroyItem (TableColumn column) { if (item != null) { int /*long*/ iter = item.handle; int modelIndex = column.modelIndex; - OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_PIXBUF, 0, -1); - OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_TEXT, 0, -1); - OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_FOREGROUND, 0, -1); - OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_BACKGROUND, 0, -1); - OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_FONT, 0, -1); + OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_PIXBUF, (int /*long*/)0, -1); + OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_TEXT, (int /*long*/)0, -1); + OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_FOREGROUND, (int /*long*/)0, -1); + OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_BACKGROUND, (int /*long*/)0, -1); + OS.gtk_list_store_set (modelHandle, iter, modelIndex + CELL_FONT, (int /*long*/)0, -1); Font [] cellFont = item.cellFont; if (cellFont != null) { 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 f1fc5aaa52..7eb81b0adf 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 @@ -214,9 +214,13 @@ void clear () { if (parent.currentItem == this) return; if (cached || (parent.style & SWT.VIRTUAL) == 0) { int columnCount = OS.gtk_tree_model_get_n_columns (parent.modelHandle); - for (int i=0; i<columnCount; i++) { + /* the columns before FOREGROUND_COLUMN contain int values, subsequent columns contain pointers */ + for (int i=Table.CHECKED_COLUMN; i<Table.FOREGROUND_COLUMN; i++) { OS.gtk_list_store_set (parent.modelHandle, handle, i, 0, -1); } + for (int i=Table.FOREGROUND_COLUMN; i<columnCount; i++) { + OS.gtk_list_store_set (parent.modelHandle, handle, i, (int /*long*/)0, -1); + } /* * Bug in GTK. When using fixed-height-mode, * row changes do not cause the row to be repainted. The fix is to diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index 94a93419ff..673b967bae 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -564,12 +564,12 @@ void copyModel (int /*long*/ oldModel, int oldStart, int /*long*/ newModel, int if (item != null) { int /*long*/ oldItem = item.handle; oldItems[oldIndex++] = oldItem; - /* the first three columns contain int values, subsequent columns contain pointers */ - for (int j = 0; j < 3; j++) { + /* the columns before FOREGROUND_COLUMN contain int values, subsequent columns contain pointers */ + for (int j = 0; j < FOREGROUND_COLUMN; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr1, -1); OS.gtk_tree_store_set (newModel, newItem, j, ptr1 [0], -1); } - for (int j = 3; j < FIRST_COLUMN; j++) { + for (int j = FOREGROUND_COLUMN; j < FIRST_COLUMN; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1); OS.gtk_tree_store_set (newModel, newItem, j, ptr [0], -1); if (types [j] == OS.G_TYPE_STRING ()) { @@ -1007,11 +1007,11 @@ void destroyItem (TreeColumn column) { if (item != null) { int /*long*/ iter = item.handle; int modelIndex = column.modelIndex; - OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_PIXBUF, 0, -1); - OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_TEXT, 0, -1); - OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_FOREGROUND, 0, -1); - OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_BACKGROUND, 0, -1); - OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_FONT, 0, -1); + OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_PIXBUF, (int /*long*/)0, -1); + OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_TEXT, (int /*long*/)0, -1); + OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_FOREGROUND, (int /*long*/)0, -1); + OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_BACKGROUND, (int /*long*/)0, -1); + OS.gtk_tree_store_set (modelHandle, iter, modelIndex + CELL_FONT, (int /*long*/)0, -1); Font [] cellFont = item.cellFont; if (cellFont != null) { 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 98f73da4c0..7b07001b15 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 @@ -295,9 +295,13 @@ void clear () { if (parent.currentItem == this) return; if (cached || (parent.style & SWT.VIRTUAL) == 0) { int columnCount = OS.gtk_tree_model_get_n_columns (parent.modelHandle); - for (int i=Tree.CHECKED_COLUMN; i<columnCount; i++) { + /* the columns before FOREGROUND_COLUMN contain int values, subsequent columns contain pointers */ + for (int i=Tree.CHECKED_COLUMN; i<Tree.FOREGROUND_COLUMN; i++) { OS.gtk_tree_store_set (parent.modelHandle, handle, i, 0, -1); } + for (int i=Tree.FOREGROUND_COLUMN; i<columnCount; i++) { + OS.gtk_tree_store_set (parent.modelHandle, handle, i, (int /*long*/)0, -1); + } /* * Bug in GTK. When using fixed-height-mode, * row changes do not cause the row to be repainted. The fix is to |