diff dwtx/jface/text/DefaultDocumentAdapter.d @ 174:c6d7b1ea700b

First sample running
author Frank Benoit <benoit@tionex.de>
date Thu, 11 Sep 2008 00:32:24 +0200
parents 1a5b8f8129df
children
line wrap: on
line diff
--- a/dwtx/jface/text/DefaultDocumentAdapter.d	Wed Sep 10 23:17:25 2008 +0200
+++ b/dwtx/jface/text/DefaultDocumentAdapter.d	Thu Sep 11 00:32:24 2008 +0200
@@ -569,7 +569,16 @@
      + DWT extension
      +/
     public int utf8AdjustOffset( int offset ){
-        implMissing(__FILE__,__LINE__);
+        if (fDocument is null)
+            return offset;
+        if (offset is 0)
+            return offset;
+        if( offset >= fDocument.getLength() ){
+            return offset;
+        }
+        while( fDocument.getChar(offset) & 0xC0 is 0x80 && offset > 0 ){
+            offset--;
+        }
         return offset;
     }
 }