diff dwtx/jface/text/projection/ProjectionDocumentManager.d @ 134:51e6e63f930e

Regex fix for casts
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 01:46:20 +0200
parents c4fb132a086c
children b6bad70d540a
line wrap: on
line diff
--- a/dwtx/jface/text/projection/ProjectionDocumentManager.d	Sun Aug 24 01:29:22 2008 +0200
+++ b/dwtx/jface/text/projection/ProjectionDocumentManager.d	Sun Aug 24 01:46:20 2008 +0200
@@ -73,7 +73,7 @@
      * @param projection the projection document
      */
     private void add(IDocument master, ProjectionDocument projection) {
-        List list= (List) fProjectionRegistry.get(master);
+        List list= cast(List) fProjectionRegistry.get(master);
         if (list is null) {
             list= new ArrayList(1);
             fProjectionRegistry.put(master, list);
@@ -88,7 +88,7 @@
      * @param projection the projection document
      */
     private void remove(IDocument master, ProjectionDocument projection) {
-        List list= (List) fProjectionRegistry.get(master);
+        List list= cast(List) fProjectionRegistry.get(master);
         if (list !is null) {
             list.remove(projection);
             if (list.size() is 0)
@@ -114,7 +114,7 @@
      * @return an iterator for all registered projection documents or <code>null</code>
      */
     private Iterator getProjectionsIterator(IDocument master) {
-        List list= (List) fProjectionRegistry.get(master);
+        List list= cast(List) fProjectionRegistry.get(master);
         if (list !is null)
             return list.iterator();
         return null;
@@ -133,7 +133,7 @@
             return;
 
         while (e.hasNext()) {
-            ProjectionDocument document= (ProjectionDocument) e.next();
+            ProjectionDocument document= cast(ProjectionDocument) e.next();
             if (about)
                 document.masterDocumentAboutToBeChanged(masterEvent);
             else
@@ -160,7 +160,7 @@
      */
     public IDocumentInformationMapping createMasterSlaveMapping(IDocument slave) {
         if (slave instanceof ProjectionDocument) {
-            ProjectionDocument projectionDocument= (ProjectionDocument) slave;
+            ProjectionDocument projectionDocument= cast(ProjectionDocument) slave;
             return projectionDocument.getDocumentInformationMapping();
         }
         return null;
@@ -192,7 +192,7 @@
      */
     public void freeSlaveDocument(IDocument slave) {
         if (slave instanceof ProjectionDocument) {
-            ProjectionDocument projectionDocument= (ProjectionDocument) slave;
+            ProjectionDocument projectionDocument= cast(ProjectionDocument) slave;
             IDocument master= projectionDocument.getMasterDocument();
             remove(master, projectionDocument);
             projectionDocument.dispose();
@@ -206,7 +206,7 @@
      */
     public IDocument getMasterDocument(IDocument slave) {
         if (slave instanceof ProjectionDocument)
-            return ((ProjectionDocument) slave).getMasterDocument();
+            return (cast(ProjectionDocument) slave).getMasterDocument();
         return null;
     }
 
@@ -222,14 +222,14 @@
      */
     public void setAutoExpandMode(IDocument slave, bool autoExpanding) {
         if (slave instanceof ProjectionDocument)
-            ((ProjectionDocument) slave).setAutoExpandMode(autoExpanding);
+            (cast(ProjectionDocument) slave).setAutoExpandMode(autoExpanding);
     }
 
     /*
      * @see dwtx.jface.text.ISlaveDocumentManagerExtension#getSlaveDocuments(dwtx.jface.text.IDocument)
      */
     public IDocument[] getSlaveDocuments(IDocument master) {
-        List list= (List) fProjectionRegistry.get(master);
+        List list= cast(List) fProjectionRegistry.get(master);
         if (list !is null) {
             IDocument[] result= new IDocument[list.size()];
             list.toArray(result);