Revert "Bug 497812 - requestLayout not layout correctly"

This reverts commit 34178a39a9bbcf038533dd42605b8348974fd195.

Change-Id: Id7aee3f7a361caf995c43e67d813d154307f6e87
Signed-off-by: Stefan Xenos <sxenos@gmail.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
index cfd52dc..385b232 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
@@ -226,12 +226,7 @@
 	}
 	for (int i=0; i<changed.length; i++) {
 		Control child = changed [i];
-		Composite composite;
-		if (child instanceof Composite) {
-			composite = (Composite)child;
-		} else {
-			composite = child.parent;
-		}
+		Composite composite = child.parent;
 		while (child != this) {
 			if (composite.layout == null || !composite.layout.flushCache (child)) {
 				composite.state |= LAYOUT_CHANGED;
@@ -872,12 +867,7 @@
 		Composite [] update = new Composite [16];
 		for (int i=0; i<changed.length; i++) {
 			Control child = changed [i];
-			Composite composite;
-			if (child instanceof Composite) {
-				composite = (Composite)child;
-			} else {
-				composite = child.parent;
-			}
+			Composite composite = child.parent;
 			while (child != this) {
 				if (composite.layout != null) {
 					composite.state |= LAYOUT_NEEDED;
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 eec1dfc..2475336 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
@@ -197,12 +197,7 @@
 	}
 	for (int i=0; i<changed.length; i++) {
 		Control child = changed [i];
-		Composite composite;
-		if (child instanceof Composite) {
-			composite = (Composite)child;
-		} else {
-			composite = child.parent;
-		}
+		Composite composite = child.parent;
 		while (child != this) {
 			if (composite.layout == null || !composite.layout.flushCache (child)) {
 				composite.state |= LAYOUT_CHANGED;
@@ -1180,12 +1175,7 @@
 		Composite [] update = new Composite [16];
 		for (int i=0; i<changed.length; i++) {
 			Control child = changed [i];
-			Composite composite;
-			if (child instanceof Composite) {
-				composite = (Composite)child;
-			} else {
-				composite = child.parent;
-			}
+			Composite composite = child.parent;
 			while (child != this) {
 				if (composite.layout != null) {
 					composite.state |= LAYOUT_NEEDED;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
index f0b0f74..0eca1af 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
@@ -174,12 +174,7 @@
 	}
 	for (int i=0; i<changed.length; i++) {
 		Control child = changed [i];
-		Composite composite;
-		if (child instanceof Composite) {
-			composite = (Composite)child;
-		} else {
-			composite = child.parent;
-		}
+		Composite composite = child.parent;
 		while (child != this) {
 			if (composite.layout == null || !composite.layout.flushCache (child)) {
 				composite.state |= LAYOUT_CHANGED;
@@ -849,12 +844,7 @@
 		Composite [] update = new Composite [16];
 		for (int i=0; i<changed.length; i++) {
 			Control child = changed [i];
-			Composite composite;
-			if (child instanceof Composite) {
-				composite = (Composite)child;
-			} else {
-				composite = child.parent;
-			}
+			Composite composite = child.parent;
 			while (child != this) {
 				if (composite.layout != null) {
 					composite.state |= LAYOUT_NEEDED;