summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorGrant Gayed2012-09-06 05:50:37 (EDT)
committer Silenio Quarti2012-09-14 14:19:37 (EDT)
commit66b9a14c42b1c03ff0164a2a4d3927a277442aea (patch)
treea9683dc1a955dff057b0f3a0ccb47fabe287e098
parent79faf570c3e90a5c550080e77c9c25602c6cd152 (diff)
downloadeclipse.platform.swt-66b9a14c42b1c03ff0164a2a4d3927a277442aea.zip
eclipse.platform.swt-66b9a14c42b1c03ff0164a2a4d3927a277442aea.tar.gz
eclipse.platform.swt-66b9a14c42b1c03ff0164a2a4d3927a277442aea.tar.bz2
Bug 381407 - reproducible crash in Debug's Variables view (ppc64)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java6
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 0437f78..54c0ecd 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 237a26d..7c9a4d5 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 0d1bf4b..8416e69 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 b9651de..9552ddb 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