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

Regex instanceof changes
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 02:26:23 +0200
parents 25170b5a8951
children 26688fec6d23
line wrap: on
line diff
--- a/dwtx/jface/text/source/AnnotationModel.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationModel.d	Sun Aug 24 02:26:23 2008 +0200
@@ -520,7 +520,7 @@
     public void addAnnotationModelListener(IAnnotationModelListener listener) {
         if (!fAnnotationModelListeners.contains(listener)) {
             fAnnotationModelListeners.add(listener);
-            if (listener instanceof IAnnotationModelListenerExtension) {
+            if ( cast(IAnnotationModelListenerExtension)listener ) {
                 IAnnotationModelListenerExtension extension= cast(IAnnotationModelListenerExtension) listener;
                 AnnotationModelEvent event= createAnnotationModelEvent();
                 event.markSealed();
@@ -676,7 +676,7 @@
         Iterator e= v.iterator();
         while (e.hasNext()) {
             IAnnotationModelListener l= cast(IAnnotationModelListener) e.next();
-            if (l instanceof IAnnotationModelListenerExtension)
+            if ( cast(IAnnotationModelListenerExtension)l )
                 (cast(IAnnotationModelListenerExtension) l).modelChanged(event);
             else if (l !is null)
                 l.modelChanged(this);
@@ -774,7 +774,7 @@
         Iterator it= fAttachments.keySet().iterator();
         while (it.hasNext()) {
             IAnnotationModel attachment= cast(IAnnotationModel) fAttachments.get(it.next());
-            if (attachment instanceof IAnnotationModelExtension2)
+            if ( cast(IAnnotationModelExtension2)attachment )
                 iterators.add((cast(IAnnotationModelExtension2) attachment).getAnnotationIterator(offset, length, canStartBefore, canEndAfter));
             else
                 iterators.add(new RegionIterator(attachment.getAnnotationIterator(), attachment, offset, length, canStartBefore, canEndAfter));
@@ -795,7 +795,7 @@
      * @since 3.4
      */
     private Iterator getRegionAnnotationIterator(int offset, int length, bool canStartBefore, bool canEndAfter) {
-        if (!(fDocument instanceof AbstractDocument))
+        if (!( cast(AbstractDocument)fDocument ))
             return new RegionIterator(getAnnotationIterator(true), this, offset, length, canStartBefore, canEndAfter);
         
         AbstractDocument document= cast(AbstractDocument) fDocument;