Mercurial > projects > dwt-addons
diff dwtx/jface/text/rules/DefaultPartitioner.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | 3678e4f1a766 |
children | eb98a5cbfd78 |
line wrap: on
line diff
--- a/dwtx/jface/text/rules/DefaultPartitioner.d Wed Aug 27 14:49:30 2008 +0200 +++ b/dwtx/jface/text/rules/DefaultPartitioner.d Mon Sep 08 00:51:37 2008 +0200 @@ -128,7 +128,7 @@ public this(IPartitionTokenScanner scanner, String[] legalContentTypes) { fScanner= scanner; fLegalContentTypes= TextUtilities.copy(legalContentTypes); - fPositionCategory= CONTENT_TYPES_CATEGORY + toHash(); + fPositionCategory= CONTENT_TYPES_CATEGORY ~ Integer.toString(toHash()); fPositionUpdater= new DefaultPositionUpdater(fPositionCategory); } @@ -152,7 +152,7 @@ * @since 3.1 */ public void connect(IDocument document, bool delayInitialization) { - Assert.isNotNull(document); + Assert.isNotNull(cast(Object)document); Assert.isTrue(!document.containsPositionCategory(fPositionCategory)); fDocument= document; @@ -558,8 +558,8 @@ */ protected String getTokenContentType(IToken token) { Object data= token.getData(); - if ( cast(String)data ) - return cast(String) data; + if ( auto str = cast(ArrayWrapperString)data ) + return str.array; return null; } @@ -653,9 +653,7 @@ } catch (BadPositionCategoryException x) { } - TypedRegion[] result= new TypedRegion[list.size()]; - list.toArray(result); - return result; + return arraycast!(ITypedRegion)(list.toArray()); } /**