Mercurial > projects > dwt-addons
diff dwtx/jface/text/DocumentCommand.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 | 6dcb0baaa031 |
line wrap: on
line diff
--- a/dwtx/jface/text/DocumentCommand.d Sun Aug 24 01:29:22 2008 +0200 +++ b/dwtx/jface/text/DocumentCommand.d Sun Aug 24 01:46:20 2008 +0200 @@ -248,7 +248,7 @@ if (isEqual(object)) return 0; - final Command command= (Command) object; + final Command command= cast(Command) object; // diff middle points if not intersecting if (fOffset + fLength <= command.fOffset || command.fOffset + command.fLength <= fOffset) { @@ -265,7 +265,7 @@ return true; if (!(object instanceof Command)) return false; - final Command command= (Command) object; + final Command command= cast(Command) object; return command.fOffset is fOffset && command.fLength is fLength; } } @@ -363,7 +363,7 @@ return tempCommand; } - final Command command= (Command) fIterator.next(); + final Command command= cast(Command) fIterator.next(); final int compareValue= command.compareTo(fCommand); if ((compareValue < 0) ^ !fForward) { @@ -486,11 +486,11 @@ final int insertionIndex= -(index + 1); // overlaps to the right? - if (insertionIndex !is fCommands.size() && intersects((Command) fCommands.get(insertionIndex), command)) + if (insertionIndex !is fCommands.size() && intersects(cast(Command) fCommands.get(insertionIndex), command)) throw new BadLocationException(); // overlaps to the left? - if (insertionIndex !is 0 && intersects((Command) fCommands.get(insertionIndex - 1), command)) + if (insertionIndex !is 0 && intersects(cast(Command) fCommands.get(insertionIndex - 1), command)) throw new BadLocationException(); fCommands.add(insertionIndex, command); @@ -571,7 +571,7 @@ final Command originalCommand= new Command(offset, length, text, owner); for (final Iterator iterator= new CommandIterator(fCommands, originalCommand, false); iterator.hasNext(); ) - ((Command) iterator.next()).execute(document); + (cast(Command) iterator.next()).execute(document); } catch (BadLocationException e) { // ignore