Mercurial > projects > dwt-addons
diff dwtx/jface/text/DefaultUndoManager.d @ 138:b6bad70d540a
Regex instanceof changes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:26:23 +0200 |
parents | 25170b5a8951 |
children | 26688fec6d23 |
line wrap: on
line diff
--- a/dwtx/jface/text/DefaultUndoManager.d Sun Aug 24 02:22:48 2008 +0200 +++ b/dwtx/jface/text/DefaultUndoManager.d Sun Aug 24 02:26:23 2008 +0200 @@ -288,7 +288,7 @@ protected void undoTextChange() { try { IDocument document= fTextViewer.getDocument(); - if (document instanceof IDocumentExtension4) + if ( cast(IDocumentExtension4)document ) (cast(IDocumentExtension4)document).replace(fStart, fText.length(), fPreservedText, fUndoModificationStamp); else document.replace(fStart, fText.length(), fPreservedText); @@ -304,7 +304,7 @@ if (isConnected() && isValid()) { IDocument doc= fTextViewer.getDocument(); - if (doc instanceof IDocumentExtension4) { + if ( cast(IDocumentExtension4)doc ) { long docStamp= (cast(IDocumentExtension4)doc).getModificationStamp(); // Normal case: an undo is valid if its redo will restore document @@ -360,7 +360,7 @@ public bool canRedo() { if (isConnected() && isValid()) { IDocument doc= fTextViewer.getDocument(); - if (doc instanceof IDocumentExtension4) { + if ( cast(IDocumentExtension4)doc ) { long docStamp= (cast(IDocumentExtension4)doc).getModificationStamp(); return docStamp is IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP || docStamp is getUndoModificationStamp(); @@ -419,7 +419,7 @@ protected void redoTextChange() { try { IDocument document= fTextViewer.getDocument(); - if (document instanceof IDocumentExtension4) + if ( cast(IDocumentExtension4)document ) (cast(IDocumentExtension4)document).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp); else fTextViewer.getDocument().replace(fStart, fEnd - fStart, fText); @@ -887,7 +887,7 @@ // if we are undoing/redoing a command we generated, then ignore // the document changes associated with this undo or redo. if (event.getOperation() instanceof TextCommand) { - if (fTextViewer instanceof TextViewer) + if ( cast(TextViewer)fTextViewer ) (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(true); listenToTextChanges(false); @@ -917,7 +917,7 @@ public void run() { listenToTextChanges(true); fOperation= null; - if (fTextViewer instanceof TextViewer) + if ( cast(TextViewer)fTextViewer ) (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(false); } }); @@ -1458,7 +1458,7 @@ * @since 3.0 */ protected void selectAndReveal(int offset, int length) { - if (fTextViewer instanceof ITextViewerExtension5) { + if ( cast(ITextViewerExtension5)fTextViewer ) { ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer; extension.exposeModelRange(new Region(offset, length)); } else if (!fTextViewer.overlapsWithVisibleRegion(offset, length))