Mercurial > projects > dwt-addons
diff dwtx/jface/text/link/LinkedPositionGroup.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 | 6dcb0baaa031 |
line wrap: on
line diff
--- a/dwtx/jface/text/link/LinkedPositionGroup.d Sun Aug 24 01:29:22 2008 +0200 +++ b/dwtx/jface/text/link/LinkedPositionGroup.d Sun Aug 24 01:46:20 2008 +0200 @@ -138,7 +138,7 @@ */ private void enforceEqualContent(LinkedPosition position) throws BadLocationException { if (fPositions.size() > 0) { - LinkedPosition groupPosition= (LinkedPosition) fPositions.get(0); + LinkedPosition groupPosition= cast(LinkedPosition) fPositions.get(0); String groupContent= groupPosition.getContent(); String positionContent= position.getContent(); if (!groupContent.equals(positionContent)) @@ -156,7 +156,7 @@ */ private void enforceDisjoint(LinkedPosition position) throws BadLocationException { for (Iterator it= fPositions.iterator(); it.hasNext(); ) { - LinkedPosition p= (LinkedPosition) it.next(); + LinkedPosition p= cast(LinkedPosition) it.next(); if (p.overlapsWith(position)) throw new BadLocationException(); } @@ -171,7 +171,7 @@ void enforceDisjoint(LinkedPositionGroup group) throws BadLocationException { Assert.isNotNull(group); for (Iterator it= group.fPositions.iterator(); it.hasNext(); ) { - LinkedPosition p= (LinkedPosition) it.next(); + LinkedPosition p= cast(LinkedPosition) it.next(); enforceDisjoint(p); } } @@ -189,7 +189,7 @@ fLastRegion= null; for (Iterator it= fPositions.iterator(); it.hasNext(); ) { - LinkedPosition pos= (LinkedPosition) it.next(); + LinkedPosition pos= cast(LinkedPosition) it.next(); if (overlapsOrTouches(pos, event)) { if (fLastPosition !is null) { fLastPosition= null; @@ -253,11 +253,11 @@ text= ""; //$NON-NLS-1$ for (Iterator it= fPositions.iterator(); it.hasNext(); ) { - LinkedPosition p= (LinkedPosition) it.next(); + LinkedPosition p= cast(LinkedPosition) it.next(); if (p is fLastPosition || p.isDeleted()) continue; // don't re-update the origin of the change - List edits= (List) map.get(p.getDocument()); + List edits= cast(List) map.get(p.getDocument()); if (edits is null) { edits= new ArrayList(); map.put(p.getDocument(), edits); @@ -268,9 +268,9 @@ try { for (Iterator it= map.keySet().iterator(); it.hasNext();) { - IDocument d= (IDocument) it.next(); + IDocument d= cast(IDocument) it.next(); TextEdit edit= new MultiTextEdit(0, d.getLength()); - edit.addChildren((TextEdit[]) ((List) map.get(d)).toArray(new TextEdit[0])); + edit.addChildren((TextEdit[]) (cast(List) map.get(d)).toArray(new TextEdit[0])); map.put(d, edit); } @@ -298,7 +298,7 @@ fIsSealed= true; if (fHasCustomIteration is false && fPositions.size() > 0) { - ((LinkedPosition) fPositions.get(0)).setSequenceNumber(0); + (cast(LinkedPosition) fPositions.get(0)).setSequenceNumber(0); } } @@ -306,7 +306,7 @@ IDocument[] docs= new IDocument[fPositions.size()]; int i= 0; for (Iterator it= fPositions.iterator(); it.hasNext(); i++) { - LinkedPosition pos= (LinkedPosition) it.next(); + LinkedPosition pos= cast(LinkedPosition) it.next(); docs[i]= pos.getDocument(); } return docs; @@ -314,7 +314,7 @@ void register(LinkedModeModel model) throws BadLocationException { for (Iterator it= fPositions.iterator(); it.hasNext(); ) { - LinkedPosition pos= (LinkedPosition) it.next(); + LinkedPosition pos= cast(LinkedPosition) it.next(); model.register(pos); } } @@ -332,10 +332,10 @@ LinkedPosition adopt(LinkedPositionGroup group) throws BadLocationException { LinkedPosition found= null; for (Iterator it= group.fPositions.iterator(); it.hasNext(); ) { - LinkedPosition pos= (LinkedPosition) it.next(); + LinkedPosition pos= cast(LinkedPosition) it.next(); LinkedPosition localFound= null; for (Iterator it2= fPositions.iterator(); it2.hasNext(); ) { - LinkedPosition myPos= (LinkedPosition) it2.next(); + LinkedPosition myPos= cast(LinkedPosition) it2.next(); if (myPos.includes(pos)) { if (found is null) found= myPos; @@ -360,7 +360,7 @@ */ LinkedPosition getPosition(LinkedPosition toFind) { for (Iterator it= fPositions.iterator(); it.hasNext(); ) { - LinkedPosition p= (LinkedPosition) it.next(); + LinkedPosition p= cast(LinkedPosition) it.next(); if (p.includes(toFind)) return p; } @@ -376,7 +376,7 @@ */ bool contains(int offset) { for (Iterator it= fPositions.iterator(); it.hasNext(); ) { - LinkedPosition pos= (LinkedPosition) it.next(); + LinkedPosition pos= cast(LinkedPosition) it.next(); if (pos.includes(offset)) { return true; } @@ -423,7 +423,7 @@ */ bool contains(Position position) { for (Iterator it= fPositions.iterator(); it.hasNext(); ) { - LinkedPosition p= (LinkedPosition) it.next(); + LinkedPosition p= cast(LinkedPosition) it.next(); if (position.equals(p)) return true; }