Mercurial > projects > dwt-addons
diff dwtx/jface/text/source/OverviewRuler.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/text/source/OverviewRuler.d Sun Aug 24 01:29:22 2008 +0200 +++ b/dwtx/jface/text/source/OverviewRuler.d Sun Aug 24 01:46:20 2008 +0200 @@ -246,7 +246,7 @@ bool ignr= (fStyle & IGNORE_BAGS) !is 0; while (fIterator.hasNext()) { - Annotation next= (Annotation) fIterator.next(); + Annotation next= cast(Annotation) fIterator.next(); if (next.isMarkedDeleted()) continue; @@ -267,7 +267,7 @@ private bool isSubtype(Object annotationType) { if (fAnnotationAccess instanceof IAnnotationAccessExtension) { - IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess; + IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; return extension.isSubtype(annotationType, fType); } return fType.equals(annotationType); @@ -693,7 +693,7 @@ for (int i= 0; e.hasNext(); i++) { - Annotation a= (Annotation) e.next(); + Annotation a= cast(Annotation) e.next(); Position p= fModel.getPosition(a); if (p is null || !p.overlapsWith(visible.getOffset(), visible.getLength())) @@ -704,7 +704,7 @@ int annotationLength= annotationEnd - annotationOffset; try { - if (ANNOTATION_HEIGHT_SCALABLE) { + if cast(ANNOTATION_HEIGHT_SCALABLE) { int numbersOfLines= document.getNumberOfLines(annotationOffset, annotationLength); // don't count empty trailing lines IRegion lastLine= document.getLineInformationOfOffset(annotationOffset + annotationLength); @@ -747,7 +747,7 @@ if (fModel !is null) { Iterator iter= fModel.getAnnotationIterator(); while (iter.hasNext()) { - Annotation annotation= (Annotation) iter.next(); + Annotation annotation= cast(Annotation) iter.next(); if (annotation.isMarkedDeleted()) continue; @@ -771,7 +771,7 @@ Rectangle r= new Rectangle(0, 0, 0, 0); int yy, hh= ANNOTATION_HEIGHT; - ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer; + ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer; IDocument document= fTextViewer.getDocument(); StyledText textWidget= fTextViewer.getTextWidget(); @@ -796,7 +796,7 @@ for (int i= 0; e.hasNext(); i++) { - Annotation a= (Annotation) e.next(); + Annotation a= cast(Annotation) e.next(); Position p= fModel.getPosition(a); if (p is null) @@ -807,7 +807,7 @@ continue; try { - if (ANNOTATION_HEIGHT_SCALABLE) { + if cast(ANNOTATION_HEIGHT_SCALABLE) { int numbersOfLines= document.getNumberOfLines(p.getOffset(), p.getLength()); // don't count empty trailing lines IRegion lastLine= document.getLineInformationOfOffset(p.getOffset() + p.getLength()); @@ -909,7 +909,7 @@ lines[1]= (pixel1 * maxLines) / rulerLength; if (fTextViewer instanceof ITextViewerExtension5) { - ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer; + ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer; lines[0]= extension.widgetLine2ModelLine(lines[0]); lines[1]= extension.widgetLine2ModelLine(lines[1]); } else { @@ -952,7 +952,7 @@ Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY); while (e.hasNext() && found is null) { - Annotation a= (Annotation) e.next(); + Annotation a= cast(Annotation) e.next(); if (a.isMarkedDeleted()) continue; @@ -1074,7 +1074,7 @@ if (layer >= 0) { int i= 0; int size= fLayersSortedByLayer.size(); - while (i < size && layer >= ((Integer)fLayersSortedByLayer.get(i)).intValue()) + while (i < size && layer >= (cast(Integer)fLayersSortedByLayer.get(i)).intValue()) i++; Integer layerObj= new Integer(layer); fLayersSortedByLayer.add(i, layerObj); @@ -1126,7 +1126,7 @@ * @since 3.0 */ private bool contains(Object annotationType, Map allowed, Set configured) { - Boolean cached= (Boolean) allowed.get(annotationType); + Boolean cached= cast(Boolean) allowed.get(annotationType); if (cached !is null) return cached.booleanValue(); @@ -1148,7 +1148,7 @@ */ private bool isCovered(Object annotationType, Set configured) { if (fAnnotationAccess instanceof IAnnotationAccessExtension) { - IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess; + IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; Iterator e= configured.iterator(); while (e.hasNext()) { if (extension.isSubtype(annotationType,e.next())) @@ -1170,9 +1170,9 @@ */ 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) + 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) ); } @@ -1231,16 +1231,16 @@ * @since 3.0 */ private Color findColor(Object annotationType) { - Color color= (Color) fAnnotationTypes2Colors.get(annotationType); + Color color= cast(Color) fAnnotationTypes2Colors.get(annotationType); if (color !is null) return color; if (fAnnotationAccess instanceof IAnnotationAccessExtension) { - IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess; + IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; Object[] superTypes= extension.getSupertypes(annotationType); if (superTypes !is null) { for (int i= 0; i < superTypes.length; i++) { - color= (Color) fAnnotationTypes2Colors.get(superTypes[i]); + color= cast(Color) fAnnotationTypes2Colors.get(superTypes[i]); if (color !is null) return color; } @@ -1407,10 +1407,10 @@ Iterator e= new FilterIterator(annotationType, FilterIterator.PERSISTENT | FilterIterator.TEMPORARY | FilterIterator.IGNORE_BAGS, fCachedAnnotations.iterator()); while (e.hasNext()) { - Annotation annotation= (Annotation)e.next(); + Annotation annotation= cast(Annotation)e.next(); if (annotation !is null) { if (annotationTypeLabel is null) - annotationTypeLabel= ((IAnnotationAccessExtension)fAnnotationAccess).getTypeLabel(annotation); + annotationTypeLabel= (cast(IAnnotationAccessExtension)fAnnotationAccess).getTypeLabel(annotation); count++; } }