diff dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.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/internal/text/link/contentassist/CompletionProposalPopup2.d	Sun Aug 24 01:29:22 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d	Sun Aug 24 01:46:20 2008 +0200
@@ -227,7 +227,7 @@
 
                     if (count is 1 && !autoActivated && fContentAssistant.isAutoInserting())
 
-                        insertProposal(fComputedProposals[0], (char) 0, 0, fInvocationOffset);
+                        insertProposal(fComputedProposals[0], cast(wchar) 0, 0, fInvocationOffset);
 
                     else {
 
@@ -368,7 +368,7 @@
         ICompletionProposal p= getSelectedProposal();
         hide();
         if (p !is null)
-            insertProposal(p, (char) 0, stateMask, fViewer.getSelectedRange().x);
+            insertProposal(p, cast(wchar) 0, stateMask, fViewer.getSelectedRange().x);
     }
 
     /**
@@ -392,7 +392,7 @@
             IDocument document= fViewer.getDocument();
 
             if (fViewer instanceof ITextViewerExtension) {
-                ITextViewerExtension extension= (ITextViewerExtension) fViewer;
+                ITextViewerExtension extension= cast(ITextViewerExtension) fViewer;
                 target= extension.getRewriteTarget();
             }
 
@@ -400,15 +400,15 @@
                 target.beginCompoundChange();
 
             if (fViewer instanceof IEditingSupportRegistry) {
-                registry= (IEditingSupportRegistry) fViewer;
+                registry= cast(IEditingSupportRegistry) fViewer;
                 registry.register(fModificationEditingSupport);
             }
 
             if (p instanceof ICompletionProposalExtension2) {
-                ICompletionProposalExtension2 e= (ICompletionProposalExtension2) p;
+                ICompletionProposalExtension2 e= cast(ICompletionProposalExtension2) p;
                 e.apply(fViewer, trigger, stateMask, offset);
             } else if (p instanceof ICompletionProposalExtension) {
-                ICompletionProposalExtension e= (ICompletionProposalExtension) p;
+                ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
                 e.apply(document, trigger, offset);
             } else {
                 p.apply(document);
@@ -425,7 +425,7 @@
 
                 int position;
                 if (p instanceof ICompletionProposalExtension) {
-                    ICompletionProposalExtension e= (ICompletionProposalExtension) p;
+                    ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
                     position= e.getContextInformationPosition();
                 } else {
                     if (selection is null)
@@ -469,7 +469,7 @@
         unregister();
 
         if (fViewer instanceof IEditingSupportRegistry) {
-            IEditingSupportRegistry registry= (IEditingSupportRegistry) fViewer;
+            IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
             registry.unregister(fFocusEditingSupport);
         }
 
@@ -503,7 +503,7 @@
 
         if (fLastProposal !is null) {
             if (fLastProposal instanceof ICompletionProposalExtension2) {
-                ICompletionProposalExtension2 extension= (ICompletionProposalExtension2) fLastProposal;
+                ICompletionProposalExtension2 extension= cast(ICompletionProposalExtension2) fLastProposal;
                 extension.unselected(fViewer);
             }
 
@@ -534,7 +534,7 @@
 
             ICompletionProposal oldProposal= getSelectedProposal();
             if (oldProposal instanceof ICompletionProposalExtension2)
-                ((ICompletionProposalExtension2) oldProposal).unselected(fViewer);
+                (cast(ICompletionProposalExtension2) oldProposal).unselected(fViewer);
 
             fFilteredProposals= proposals;
 
@@ -560,7 +560,7 @@
                 String displayString;
                 StyleRange[] styleRanges= null;
                 if (fIsColoredLabelsSupportEnabled && p instanceof ICompletionProposalExtension6) {
-                    StyledString styledString= ((ICompletionProposalExtension6)p).getStyledDisplayString();
+                    StyledString styledString= (cast(ICompletionProposalExtension6)p).getStyledDisplayString();
                     displayString= styledString.getString();
                     styleRanges= styledString.getStyleRanges();
                 } else
@@ -590,7 +590,7 @@
         // will cause flicker, though
         fProposalTable.setRedraw(true);
 
-        int width= adjustWidth ? DWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
+        int width= adjustWidth ? DWT.DEFAULT : (cast(GridData)fProposalTable.getLayoutData()).widthHint;
         Point size= fProposalTable.computeSize(width, DWT.DEFAULT, true);
 
         GridData data= new GridData(GridData.FILL_BOTH);
@@ -628,11 +628,11 @@
     private bool validateProposal(IDocument document, ICompletionProposal p, int offset, DocumentEvent event) {
         // detect selected
         if (p instanceof ICompletionProposalExtension2) {
-            ICompletionProposalExtension2 e= (ICompletionProposalExtension2) p;
+            ICompletionProposalExtension2 e= cast(ICompletionProposalExtension2) p;
             if (e.validate(document, offset, event))
                 return true;
         } else if (p instanceof ICompletionProposalExtension) {
-            ICompletionProposalExtension e= (ICompletionProposalExtension) p;
+            ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
             if (e.isValidFor(document, offset))
                 return true;
         }
@@ -681,7 +681,7 @@
 
 
             if (fViewer instanceof IEditingSupportRegistry) {
-                IEditingSupportRegistry registry= (IEditingSupportRegistry) fViewer;
+                IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
                 registry.register(fFocusEditingSupport);
             }
 
@@ -788,13 +788,13 @@
                 default:
                     ICompletionProposal p= getSelectedProposal();
                 if (p instanceof ICompletionProposalExtension) {
-                    ICompletionProposalExtension t= (ICompletionProposalExtension) p;
+                    ICompletionProposalExtension t= cast(ICompletionProposalExtension) p;
                     char[] triggers= t.getTriggerCharacters();
                     if (contains(triggers, key)) {
                         hide();
                         if (key is ';') {
                             e.doit= true;
-                            insertProposal(p, (char) 0, e.stateMask, fViewer.getSelectedRange().x);
+                            insertProposal(p, cast(wchar) 0, e.stateMask, fViewer.getSelectedRange().x);
                         } else {
                             e.doit= false;
                             insertProposal(p, key, e.stateMask, fViewer.getSelectedRange().x);
@@ -818,11 +818,11 @@
 
         ICompletionProposal oldProposal= getSelectedProposal();
         if (oldProposal instanceof ICompletionProposalExtension2)
-            ((ICompletionProposalExtension2) oldProposal).unselected(fViewer);
+            (cast(ICompletionProposalExtension2) oldProposal).unselected(fViewer);
 
         ICompletionProposal proposal= fFilteredProposals[index];
         if (proposal instanceof ICompletionProposalExtension2)
-            ((ICompletionProposalExtension2) proposal).selected(fViewer, smartToggle);
+            (cast(ICompletionProposalExtension2) proposal).selected(fViewer, smartToggle);
 
         fLastProposal= proposal;
 
@@ -926,13 +926,13 @@
 
             if (proposals[i] instanceof ICompletionProposalExtension2) {
 
-                ICompletionProposalExtension2 p= (ICompletionProposalExtension2) proposals[i];
+                ICompletionProposalExtension2 p= cast(ICompletionProposalExtension2) proposals[i];
                 if (p.validate(document, offset, event))
                     filtered.add(p);
 
             } else if (proposals[i] instanceof ICompletionProposalExtension) {
 
-                ICompletionProposalExtension p= (ICompletionProposalExtension) proposals[i];
+                ICompletionProposalExtension p= cast(ICompletionProposalExtension) proposals[i];
                 if (p.isValidFor(document, offset))
                     filtered.add(p);