Mercurial > projects > dwt-mac
diff dwt/custom/ViewFormLayout.d @ 7:e831403a80a9
Add 'cast' to casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:30:35 +0200 |
parents | 380af2bdd8e5 |
children | a9ab4c738ed8 |
line wrap: on
line diff
--- a/dwt/custom/ViewFormLayout.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/custom/ViewFormLayout.d Wed Aug 27 14:30:35 2008 +0200 @@ -22,7 +22,7 @@ class ViewFormLayout : Layout { protected Point computeSize(Composite composite, int wHint, int hHint, bool flushCache) { - ViewForm form = (ViewForm)composite; + ViewForm form = cast(ViewForm)composite; Control left = form.topLeft; Control center = form.topCenter; Control right = form.topRight; @@ -86,12 +86,12 @@ data = new CLayoutData(); control.setLayoutData(data); } - return ((CLayoutData)data).computeSize(control, wHint, hHint, flushCache); + return (cast(CLayoutData)data).computeSize(control, wHint, hHint, flushCache); } int computeTrim(Control c) { if (c instanceof Scrollable) { - Rectangle rect = ((Scrollable) c).computeTrim (0, 0, 0, 0); + Rectangle rect = (cast(Scrollable) c).computeTrim (0, 0, 0, 0); return rect.width; } return c.getBorderWidth () * 2; @@ -99,12 +99,12 @@ protected bool flushCache(Control control) { Object data = control.getLayoutData(); - if (data !is null && data instanceof CLayoutData) ((CLayoutData)data).flushCache(); + if (data !is null && data instanceof CLayoutData) (cast(CLayoutData)data).flushCache(); return true; } protected void layout(Composite composite, bool flushCache) { - ViewForm form = (ViewForm)composite; + ViewForm form = cast(ViewForm)composite; Control left = form.topLeft; Control center = form.topCenter; Control right = form.topRight; @@ -176,7 +176,7 @@ } if (left !is null && !left.isDisposed()) { top = true; - Rectangle trim = left instanceof Composite ? ((Composite)left).computeTrim(0, 0, 0, 0) : new Rectangle(0, 0, 0, 0); + Rectangle trim = left instanceof Composite ? (cast(Composite)left).computeTrim(0, 0, 0, 0) : new Rectangle(0, 0, 0, 0); int w = x - rect.x - form.marginWidth - form.highlight - trim.width; int h = topHeight - trim.height; leftSize = computeChildSize(left, w, h, false);