diff dwtx/jface/text/source/AnnotationRulerColumn.d @ 138:b6bad70d540a

Regex instanceof changes
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 02:26:23 +0200
parents 65801ad2b265
children f70d9508c95c
line wrap: on
line diff
--- a/dwtx/jface/text/source/AnnotationRulerColumn.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationRulerColumn.d	Sun Aug 24 02:26:23 2008 +0200
@@ -287,7 +287,7 @@
      */
     public this(int width, IAnnotationAccess annotationAccess) {
         fWidth= width;
-        if (annotationAccess instanceof IAnnotationAccessExtension)
+        if ( cast(IAnnotationAccessExtension)annotationAccess )
             fAnnotationAccessExtension= cast(IAnnotationAccessExtension) annotationAccess;
     }
 
@@ -478,7 +478,7 @@
     protected bool hasAnnotation(int lineNumber) {
 
         IAnnotationModel model= fModel;
-        if (fModel instanceof IAnnotationModelExtension)
+        if ( cast(IAnnotationModelExtension)fModel )
             model= (cast(IAnnotationModelExtension)fModel).getAnnotationModel(SourceViewer.MODEL_ANNOTATION_MODEL);
 
         if (model is null)
@@ -499,7 +499,7 @@
         int lineLength= line.getLength();
 
         Iterator e;
-        if (fModel instanceof IAnnotationModelExtension2)
+        if ( cast(IAnnotationModelExtension2)fModel )
             e= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(lineStart, lineLength + 1, true, true);
         else
             e= model.getAnnotationIterator();
@@ -580,7 +580,7 @@
             gc.setBackground(fCanvas.getBackground());
             gc.fillRectangle(0, 0, size.x, size.y);
 
-            if (fCachedTextViewer instanceof ITextViewerExtension5)
+            if ( cast(ITextViewerExtension5)fCachedTextViewer )
                 doPaint1(gc);
             else
                 doPaint(gc);
@@ -676,7 +676,7 @@
 
         for (int layer= 0; layer < maxLayer; layer++) {
             Iterator iter;
-            if (fModel instanceof IAnnotationModelExtension2)
+            if ( cast(IAnnotationModelExtension2)fModel )
                 iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(topLeft, viewPort + 1, true, true);
             else
                 iter= fModel.getAnnotationIterator();
@@ -766,7 +766,7 @@
         int minLayer= Integer.MAX_VALUE, maxLayer= Integer.MIN_VALUE;
         fCachedAnnotations.clear();
         Iterator iter;
-        if (fModel instanceof IAnnotationModelExtension2)
+        if ( cast(IAnnotationModelExtension2)fModel )
             iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(vOffset, vLength + 1, true, true);
         else
             iter= fModel.getAnnotationIterator();