diff dwt/layout/FormLayout.d @ 7:e831403a80a9

Add 'cast' to casts
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:30:35 +0200
parents 1a8b3cb347e0
children a9ab4c738ed8
line wrap: on
line diff
--- a/dwt/layout/FormLayout.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/layout/FormLayout.d	Wed Aug 27 14:30:35 2008 +0200
@@ -169,18 +169,18 @@
  * Computes the preferred height of the form with
  * respect to the preferred height of the control.
  * 
- * Given that the equations for top (T) and bottom (B)
- * of the control in terms of the height of the form (X)
+ * Given that the equations for top cast(T) and bottom cast(B)
+ * of the control in terms of the height of the form cast(X)
  * are:
  *      T = AX + B
  *      B = CX + D
  * 
- * The equation for the height of the control (H)
- * is bottom (B) minus top (T) or (H = B - T) or:
+ * The equation for the height of the control cast(H)
+ * is bottom cast(B) minus top cast(T) or (H = B - T) or:
  * 
  *      H = (CX + D) - (AX + B)
  * 
- * Solving for (X), the height of the form, we get:
+ * Solving for cast(X), the height of the form, we get:
  * 
  *      X = (H + B - D) / (C - A)
  * 
@@ -188,7 +188,7 @@
  * solution for X.  This is a special case meaning that
  * the control does not constrain the height of the
  * form.  In this case, we need to arbitrarily define
- * the height of the form (X):
+ * the height of the form cast(X):
  * 
  * Case 1: A = C, A = 0, C = 0
  *
@@ -250,7 +250,7 @@
 
 protected bool flushCache (Control control) {
     Object data = control.getLayoutData ();
-    if (data !is null) ((FormData) data).flushCache ();
+    if (data !is null) (cast(FormData) data).flushCache ();
     return true;
 }
 
@@ -294,7 +294,7 @@
     Control [] children = composite.getChildren ();
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (data is null) child.setLayoutData (data = new FormData ());
         if (flushCache) data.flushCache ();
         data.cacheLeft = data.cacheRight = data.cacheTop = data.cacheBottom = null;
@@ -304,7 +304,7 @@
     int w = 0, h = 0;
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (width !is DWT.DEFAULT) {
             data.needed = false;
             FormAttachment left = data.getLeftAttachment (child, spacing, flushCache);
@@ -314,7 +314,7 @@
                 int trim = 0;
                 //TEMPORARY CODE
                 if (child instanceof Scrollable) {
-                    Rectangle rect = ((Scrollable) child).computeTrim (0, 0, 0, 0);
+                    Rectangle rect = (cast(Scrollable) child).computeTrim (0, 0, 0, 0);
                     trim = rect.width;
                 } else {
                     trim = child.getBorderWidth () * 2;
@@ -338,7 +338,7 @@
     }
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (height !is DWT.DEFAULT) {
             int y1 = data.getTopAttachment (child, spacing, flushCache).solveX (height);
             int y2 = data.getBottomAttachment (child, spacing, flushCache).solveX (height);
@@ -353,7 +353,7 @@
     }
     for (int i=0; i<children.length; i++) {
         Control child = children [i];
-        FormData data = (FormData) child.getLayoutData ();
+        FormData data = cast(FormData) child.getLayoutData ();
         if (flush !is null && flush [i]) data.cacheWidth = data.cacheHeight = -1;
         data.cacheLeft = data.cacheRight = data.cacheTop = data.cacheBottom = null;
     }