diff options
author | Silenio Quarti | 2008-01-21 19:34:32 +0000 |
---|---|---|
committer | Silenio Quarti | 2008-01-21 19:34:32 +0000 |
commit | dd5f3f01a50a375ef6e66929f7bfb233e65029c0 (patch) | |
tree | 72dae59a527f39cb3242aadd2597fe5abe0f9339 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java | |
parent | 71a8f7dd16753fa2efa318800b96563674ce4862 (diff) | |
download | eclipse.platform.swt-dd5f3f01a50a375ef6e66929f7bfb233e65029c0.tar.gz eclipse.platform.swt-dd5f3f01a50a375ef6e66929f7bfb233e65029c0.tar.xz eclipse.platform.swt-dd5f3f01a50a375ef6e66929f7bfb233e65029c0.zip |
hold on to Font object
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java | 11 |
1 files changed, 7 insertions, 4 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 8cfba20df4..31b1b8541b 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 @@ -906,9 +906,10 @@ public void setFont (Font font){ if (font != null && font.isDisposed ()) { SWT.error (SWT.ERROR_INVALID_ARGUMENT); } - if (this.font == font) return; - if (this.font != null && this.font.equals (font)) return; + Font oldFont = this.font; + if (oldFont == font) return; this.font = font; + if (oldFont != null && oldFont.equals (font)) return; int /*long*/ fontHandle = font != null ? font.handle : 0; OS.gtk_list_store_set (parent.modelHandle, handle, Table.FONT_COLUMN, fontHandle, -1); /* @@ -951,11 +952,13 @@ public void setFont (int index, Font font) { int count = Math.max (1, parent.getColumnCount ()); if (0 > index || index > count - 1) return; if (cellFont == null) { + if (font == null) return; cellFont = new Font [count]; } - if (cellFont [index] == font) return; - if (cellFont [index] != null && cellFont [index].equals (font)) return; + Font oldFont = cellFont [index]; + if (oldFont == font) return; cellFont [index] = font; + if (oldFont != null && oldFont.equals (font)) return; int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; int /*long*/ fontHandle = font != null ? font.handle : 0; |