Show
Ignore:
Timestamp:
05/04/08 18:12:38 (8 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

reverted the char[] to String and use the an alias.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/dnd/HTMLTransfer.d

    r197 r212  
    4141 
    4242    static HTMLTransfer _instance; 
    43     static const char[] HTML_FORMAT = "HTML Format"; //$NON-NLS-1$ 
     43    static const String HTML_FORMAT = "HTML Format"; //$NON-NLS-1$ 
    4444    static const int HTML_FORMATID; 
    45     static const char[] NUMBER = "00000000"; //$NON-NLS-1$ 
    46     static const char[] HEADER = "Version:0.9\r\nStartHTML:"~NUMBER~"\r\nEndHTML:"~NUMBER~"\r\nStartFragment:"~NUMBER~"\r\nEndFragment:"~NUMBER~"\r\n"; 
    47     static const char[] PREFIX = "<html><body><!--StartFragment-->"; //$NON-NLS-1$ 
    48     static const char[] SUFFIX = "<!--EndFragment--></body></html>"; //$NON-NLS-1$ 
    49     static const char[] StartFragment = "StartFragment:"; //$NON-NLS-1$ 
    50     static const char[] EndFragment = "EndFragment:"; //$NON-NLS-1$ 
     45    static const String NUMBER = "00000000"; //$NON-NLS-1$ 
     46    static const String HEADER = "Version:0.9\r\nStartHTML:"~NUMBER~"\r\nEndHTML:"~NUMBER~"\r\nStartFragment:"~NUMBER~"\r\nEndFragment:"~NUMBER~"\r\n"; 
     47    static const String PREFIX = "<html><body><!--StartFragment-->"; //$NON-NLS-1$ 
     48    static const String SUFFIX = "<!--EndFragment--></body></html>"; //$NON-NLS-1$ 
     49    static const String StartFragment = "StartFragment:"; //$NON-NLS-1$ 
     50    static const String EndFragment = "EndFragment:"; //$NON-NLS-1$ 
    5151 
    5252static this(){ 
     
    8585        DND.error(DND.ERROR_INVALID_DATA); 
    8686    } 
    87     char[] string = ( cast(ArrayWrapperString)object ).array; 
     87    String string = ( cast(ArrayWrapperString)object ).array; 
    8888    int codePage = OS.GetACP(); 
    8989    int cchMultiByte = OS.WideCharToMultiByte(codePage, 0, StrToTCHARz(string), -1, null, 0, null, null); 
     
    102102    //startHTML 
    103103    int start = buffer.toString().indexOf(NUMBER); 
    104     char[] temp = Integer.toString(startHTML); 
     104    String temp = Integer.toString(startHTML); 
    105105    buffer.select(start + maxLength-temp.length, temp.length); 
    106106    buffer.replace(temp); 
     
    174174            wchar[] lpWideCharStr = new wchar [cchWideChar - 1]; 
    175175            OS.MultiByteToWideChar (codePage, OS.MB_PRECOMPOSED, lpMultiByteStr, -1, lpWideCharStr.ptr, lpWideCharStr.length); 
    176             char[] string = WCHARzToStr(lpWideCharStr.ptr); 
     176            String string = WCHARzToStr(lpWideCharStr.ptr); 
    177177            int fragmentStart = 0, fragmentEnd = 0; 
    178178            int start = string.indexOf(StartFragment) + StartFragment.length; 
    179179            int end = start + 1; 
    180180            while (end < string.length) { 
    181                 char[] s = string.substring(start, end); 
     181                String s = string.substring(start, end); 
    182182                try { 
    183183                    fragmentStart = Integer.parseInt(s); 
     
    190190            end = start + 1; 
    191191            while (end < string.length) { 
    192                 char[] s = string.substring(start, end); 
     192                String s = string.substring(start, end); 
    193193                try { 
    194194                    fragmentEnd = Integer.parseInt(s); 
     
    203203             * the wide char version of the byte stream. 
    204204             */ 
    205             char[] s = string.substring(fragmentStart, fragmentEnd); 
     205            String s = string.substring(fragmentStart, fragmentEnd); 
    206206            /* 
    207207             * Firefox includes <!--StartFragment --> in the fragment, so remove it. 
    208208             */ 
    209             char[] foxStart = "<!--StartFragment -->\r\n"; //$NON-NLS-1$ 
     209            String foxStart = "<!--StartFragment -->\r\n"; //$NON-NLS-1$ 
    210210            int prefix = s.indexOf(foxStart); 
    211211            if (prefix !is -1) { 
     
    224224    return [HTML_FORMATID]; 
    225225} 
    226 protected char[][] getTypeNames(){ 
     226protected String[] getTypeNames(){ 
    227227    return [HTML_FORMAT]; 
    228228}