summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>2012-09-06 15:30:07 -0400
committerCarolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>2012-09-06 15:30:07 -0400
commitb9729f2b6df70fadc49c8b129fafe116a971892c (patch)
treef8a9ecb16e9e20a85902ed4e2e7e54f0ef63d2c9
parentcf0bd3fd1ec7876aa51811a1df8c52b9efccf824 (diff)
downloadeclipse.platform.swt-b9729f2b6df70fadc49c8b129fafe116a971892c.tar.gz
eclipse.platform.swt-b9729f2b6df70fadc49c8b129fafe116a971892c.tar.xz
eclipse.platform.swt-b9729f2b6df70fadc49c8b129fafe116a971892c.zip
Bug 388990 - JUnit test failures on Linux in I20120904-0800
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java11
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);
}