From b9729f2b6df70fadc49c8b129fafe116a971892c Mon Sep 17 00:00:00 2001 From: Carolyn MacLeod Date: Thu, 6 Sep 2012 15:30:07 -0400 Subject: Bug 388990 - JUnit test failures on Linux in I20120904-0800 --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java | 11 ++++------- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 13 +++++-------- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java | 11 ++++------- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java | 11 ++++------- 4 files changed, 17 insertions(+), 29 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java index 9f6c6ba29f..9c16040137 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java @@ -605,13 +605,10 @@ public Rectangle getClientArea () { } forceResize (); int /*long*/ clientHandle = clientHandle (); - int width = 0, height = 0; - if ((state & ZERO_WIDTH) == 0) { - GtkAllocation allocation = new GtkAllocation(); - gtk_widget_get_allocation (clientHandle, allocation); - width = allocation.width; - height = allocation.height; - } + GtkAllocation allocation = new GtkAllocation(); + gtk_widget_get_allocation (clientHandle, allocation); + int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width; + int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height; return new Rectangle (0, 0, width, height); } return super.getClientArea(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index e23576990a..91407953dd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -1022,14 +1022,11 @@ public void setLocation(int x, int y) { */ public Point getSize () { checkWidget(); - int width = 0, height = 0; - if ((state & ZERO_WIDTH) == 0) { - int /*long*/ topHandle = topHandle (); - GtkAllocation allocation = new GtkAllocation (); - gtk_widget_get_allocation (topHandle, allocation); - width = allocation.width; - height = allocation.height; - } + int /*long*/ topHandle = topHandle (); + GtkAllocation allocation = new GtkAllocation (); + gtk_widget_get_allocation (topHandle, allocation); + int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width; + int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height; return new Point (width, height); } 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 f5e118982d..501a8ea17c 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 @@ -1136,13 +1136,10 @@ public Rectangle getClientArea () { int [] fixedX = new int [1], fixedY = new int [1]; OS.gdk_window_get_origin (fixedWindow, fixedX, fixedY); int /*long*/ clientHandle = clientHandle (); - int width = 0, height = 0; - if ((state & ZERO_WIDTH) == 0) { - GtkAllocation allocation = new GtkAllocation (); - gtk_widget_get_allocation (clientHandle, allocation); - width = allocation.width; - height = allocation.height; - } + GtkAllocation allocation = new GtkAllocation (); + gtk_widget_get_allocation (clientHandle, allocation); + int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width; + int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height; return new Rectangle (fixedX [0] - binX [0], fixedY [0] - binY [0], width, height); } 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 67d2cf86e2..1b2b738e13 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 @@ -1131,13 +1131,10 @@ public Rectangle getClientArea () { int [] fixedX = new int [1], fixedY = new int [1]; OS.gdk_window_get_origin (fixedWindow, fixedX, fixedY); int /*long*/ clientHandle = clientHandle (); - int height = 0, width = 0; - if ((state & ZERO_WIDTH) == 0) { - GtkAllocation allocation = new GtkAllocation (); - gtk_widget_get_allocation (clientHandle, allocation); - width = allocation.width; - height = allocation.height; - } + GtkAllocation allocation = new GtkAllocation (); + gtk_widget_get_allocation (clientHandle, allocation); + int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width; + int height = (state & ZERO_HEIGHT) != 0 ? 0 : allocation.height; return new Rectangle (fixedX [0] - binX [0], fixedY [0] - binY [0], width, height); } -- cgit