Mercurial > projects > dwt-addons
diff dwtx/jface/internal/text/source/DiffPainter.d @ 134:51e6e63f930e
Regex fix for casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 01:46:20 +0200 |
parents | 7d818bd32d63 |
children | 65801ad2b265 |
line wrap: on
line diff
--- a/dwtx/jface/internal/text/source/DiffPainter.d Sun Aug 24 01:29:22 2008 +0200 +++ b/dwtx/jface/internal/text/source/DiffPainter.d Sun Aug 24 01:46:20 2008 +0200 @@ -210,7 +210,7 @@ */ private void handleDispose() { if (fLineDiffer !is null) { - ((IAnnotationModel) fLineDiffer).removeAnnotationModelListener(fAnnotationListener); + (cast(IAnnotationModel) fLineDiffer).removeAnnotationModelListener(fAnnotationListener); fLineDiffer= null; } } @@ -342,7 +342,7 @@ public void setModel(IAnnotationModel model) { IAnnotationModel newModel; if (model instanceof IAnnotationModelExtension) - newModel= ((IAnnotationModelExtension) model).getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID); + newModel= (cast(IAnnotationModelExtension) model).getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID); else newModel= model; @@ -358,10 +358,10 @@ if (differ instanceof ILineDiffer) { if (fLineDiffer !is differ) { if (fLineDiffer !is null) - ((IAnnotationModel) fLineDiffer).removeAnnotationModelListener(fAnnotationListener); - fLineDiffer= (ILineDiffer) differ; + (cast(IAnnotationModel) fLineDiffer).removeAnnotationModelListener(fAnnotationListener); + fLineDiffer= cast(ILineDiffer) differ; if (fLineDiffer !is null) - ((IAnnotationModel) fLineDiffer).addAnnotationModelListener(fAnnotationListener); + (cast(IAnnotationModel) fLineDiffer).addAnnotationModelListener(fAnnotationListener); } } } @@ -498,7 +498,7 @@ * @return the interpolated color */ private static RGB interpolate(RGB fg, RGB bg, double scale) { - return new RGB((int) ((1.0 - scale) * fg.red + scale * bg.red), (int) ((1.0 - scale) * fg.green + scale * bg.green), (int) ((1.0 - scale) * fg.blue + scale * bg.blue)); + return new RGB(cast(int) ((1.0 - scale) * fg.red + scale * bg.red), cast(int) ((1.0 - scale) * fg.green + scale * bg.green), cast(int) ((1.0 - scale) * fg.blue + scale * bg.blue)); } /** @@ -531,7 +531,7 @@ */ public bool hasInformation() { if (fLineDiffer instanceof ILineDifferExtension2) - return !((ILineDifferExtension2) fLineDiffer).isSuspended(); + return !(cast(ILineDifferExtension2) fLineDiffer).isSuspended(); return fLineDiffer !is null; }