Mercurial > projects > dwt-mac
diff dwt/layout/GridLayout.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/GridLayout.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/layout/GridLayout.d Wed Aug 27 14:30:35 2008 +0200 @@ -170,14 +170,14 @@ protected bool flushCache (Control control) { Object data = control.getLayoutData (); - if (data !is null) ((GridData) data).flushCache (); + if (data !is null) (cast(GridData) data).flushCache (); return true; } GridData getData (Control [][] grid, int row, int column, int rowCount, int columnCount, bool first) { Control control = grid [row] [column]; if (control !is null) { - GridData data = (GridData) control.getLayoutData (); + GridData data = cast(GridData) control.getLayoutData (); int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount)); int vSpan = Math.max (1, data.verticalSpan); int i = first ? row + vSpan - 1 : row - vSpan + 1; @@ -204,7 +204,7 @@ int count = 0; for (int i=0; i<children.length; i++) { Control control = children [i]; - GridData data = (GridData) control.getLayoutData (); + GridData data = cast(GridData) control.getLayoutData (); if (data is null || !data.exclude) { children [count++] = children [i]; } @@ -214,7 +214,7 @@ } for (int i=0; i<count; i++) { Control child = children [i]; - GridData data = (GridData) child.getLayoutData (); + GridData data = cast(GridData) child.getLayoutData (); if (data is null) child.setLayoutData (data = new GridData ()); if (flushCache) data.flushCache (); data.computeSize (child, data.widthHint, data.heightHint, flushCache); @@ -223,7 +223,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; @@ -242,7 +242,7 @@ Control [][] grid = new Control [4] [columnCount]; for (int i=0; i<count; i++) { Control child = children [i]; - GridData data = (GridData) child.getLayoutData (); + GridData data = cast(GridData) child.getLayoutData (); int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount)); int vSpan = Math.max (1, data.verticalSpan); while (true) { @@ -472,7 +472,7 @@ if ((currentWidth !is data.cacheWidth && data.horizontalAlignment is DWT.FILL) || (data.cacheWidth > currentWidth)) { int trim = 0; 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;