diff dwtx/jface/text/AbstractInformationControlManager.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/AbstractInformationControlManager.d	Sun Aug 24 01:29:22 2008 +0200
+++ b/dwtx/jface/text/AbstractInformationControlManager.d	Sun Aug 24 01:46:20 2008 +0200
@@ -545,7 +545,7 @@
      * @param subjectArea the subject area, or <code>null</code> if none is available
      */
     protected final void setInformation(String information, Rectangle subjectArea) {
-        setInformation((Object)information, subjectArea);
+        setInformation(cast(Object)information, subjectArea);
     }
 
     /**
@@ -618,7 +618,7 @@
     bool canReplace(IInformationControl iControl) {
         return iControl instanceof IInformationControlExtension3
                 && iControl instanceof IInformationControlExtension5
-                && ((IInformationControlExtension5) iControl).getInformationPresenterControlCreator() !is null;
+                && (cast(IInformationControlExtension5) iControl).getInformationPresenterControlCreator() !is null;
     }
     
     /**
@@ -745,7 +745,7 @@
      */
     protected void setCustomInformationControlCreator(IInformationControlCreator informationControlCreator)  {
         if (informationControlCreator !is null && fCustomInformationControlCreator  instanceof IInformationControlCreatorExtension) {
-            IInformationControlCreatorExtension extension= (IInformationControlCreatorExtension) fCustomInformationControlCreator;
+            IInformationControlCreatorExtension extension= cast(IInformationControlCreatorExtension) fCustomInformationControlCreator;
             if (extension.canReplace(informationControlCreator))
                 return;
         }
@@ -861,7 +861,7 @@
 
         if (fSizeConstraints is null) {
             if (informationControl instanceof IInformationControlExtension5) {
-                IInformationControlExtension5 iControl5= (IInformationControlExtension5) informationControl;
+                IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) informationControl;
                 fSizeConstraints= iControl5.computeSizeConstraints(fWidthConstraint, fHeightConstraint);
                 if (fSizeConstraints !is null)
                     return Geometry.copy(fSizeConstraints);
@@ -938,7 +938,7 @@
 
             creator= fCustomInformationControlCreator;
             if (creator instanceof IInformationControlCreatorExtension)  {
-                IInformationControlCreatorExtension extension= (IInformationControlCreatorExtension) creator;
+                IInformationControlCreatorExtension extension= cast(IInformationControlCreatorExtension) creator;
                 if (fInformationControl !is null && extension.canReuse(fInformationControl))
                     return fInformationControl;
             }
@@ -1275,7 +1275,7 @@
     protected void presentInformation() {
         bool hasContents= false;
         if (fInformation instanceof String)
-            hasContents= ((String)fInformation).trim().length() > 0;
+            hasContents= (cast(String)fInformation).trim().length() > 0;
         else
             hasContents= (fInformation !is null);
 
@@ -1294,7 +1294,7 @@
      */
     private void internalShowInformationControl(Rectangle subjectArea, Object information) {
         if (this instanceof InformationControlReplacer) {
-            ((InformationControlReplacer) this).showInformationControl(subjectArea, information);
+            (cast(InformationControlReplacer) this).showInformationControl(subjectArea, information);
             return;
         }
         
@@ -1303,7 +1303,7 @@
 
             Point sizeConstraints= computeSizeConstraints(fSubjectControl, fSubjectArea, informationControl);
             if (informationControl instanceof IInformationControlExtension3) {
-                IInformationControlExtension3 iControl3= (IInformationControlExtension3) informationControl;
+                IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) informationControl;
                 Rectangle trim= iControl3.computeTrim();
                 sizeConstraints.x += trim.width;
                 sizeConstraints.y += trim.height;
@@ -1311,12 +1311,12 @@
             informationControl.setSizeConstraints(sizeConstraints.x, sizeConstraints.y);
 
             if (informationControl instanceof IInformationControlExtension2)
-                ((IInformationControlExtension2)informationControl).setInput(information);
+                (cast(IInformationControlExtension2)informationControl).setInput(information);
             else
                 informationControl.setInformation(information.toString());
 
             if (informationControl instanceof IInformationControlExtension) {
-                IInformationControlExtension extension= (IInformationControlExtension)informationControl;
+                IInformationControlExtension extension= cast(IInformationControlExtension)informationControl;
                 if (!extension.hasContents())
                     return;
             }
@@ -1405,11 +1405,11 @@
      */
     void replaceInformationControl(bool takeFocus) {
         if (fInformationControlReplacer !is null && canReplace(fInformationControl)) {
-            IInformationControlExtension3 iControl3= (IInformationControlExtension3) fInformationControl;
+            IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) fInformationControl;
             Rectangle b= iControl3.getBounds();
             Rectangle t= iControl3.computeTrim();
             Rectangle contentBounds= new Rectangle(b.x - t.x, b.y - t.y, b.width - t.width, b.height - t.height);
-            IInformationControlCreator informationPresenterControlCreator= ((IInformationControlExtension5) fInformationControl).getInformationPresenterControlCreator();
+            IInformationControlCreator informationPresenterControlCreator= (cast(IInformationControlExtension5) fInformationControl).getInformationPresenterControlCreator();
             fInformationControlReplacer.replaceInformationControl(informationPresenterControlCreator, contentBounds, fInformation, fSubjectArea, takeFocus);
         }
         hideInformationControl();
@@ -1468,10 +1468,10 @@
         if (!(fInformationControl instanceof IInformationControlExtension3))
             throw new UnsupportedOperationException();
 
-        bool controlRestoresSize= ((IInformationControlExtension3)fInformationControl).restoresSize();
-        bool controlRestoresLocation= ((IInformationControlExtension3)fInformationControl).restoresLocation();
+        bool controlRestoresSize= (cast(IInformationControlExtension3)fInformationControl).restoresSize();
+        bool controlRestoresLocation= (cast(IInformationControlExtension3)fInformationControl).restoresLocation();
 
-        Rectangle bounds= ((IInformationControlExtension3)fInformationControl).getBounds();
+        Rectangle bounds= (cast(IInformationControlExtension3)fInformationControl).getBounds();
         if (bounds is null)
             return;
 
@@ -1497,8 +1497,8 @@
         if (!(fInformationControl instanceof IInformationControlExtension3))
             throw new UnsupportedOperationException();
 
-        bool controlRestoresSize= ((IInformationControlExtension3)fInformationControl).restoresSize();
-        bool controlRestoresLocation= ((IInformationControlExtension3)fInformationControl).restoresLocation();
+        bool controlRestoresSize= (cast(IInformationControlExtension3)fInformationControl).restoresSize();
+        bool controlRestoresLocation= (cast(IInformationControlExtension3)fInformationControl).restoresLocation();
 
         Rectangle bounds= new Rectangle(-1, -1, -1, -1);