Changeset 212:ab60f3309436 for dwt/dnd/HTMLTransfer.d
- Timestamp:
- 05/04/08 18:12:38 (8 months ago)
- Files:
-
- dwt/dnd/HTMLTransfer.d (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/dnd/HTMLTransfer.d
r197 r212 41 41 42 42 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$ 44 44 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$ 51 51 52 52 static this(){ … … 85 85 DND.error(DND.ERROR_INVALID_DATA); 86 86 } 87 char[]string = ( cast(ArrayWrapperString)object ).array;87 String string = ( cast(ArrayWrapperString)object ).array; 88 88 int codePage = OS.GetACP(); 89 89 int cchMultiByte = OS.WideCharToMultiByte(codePage, 0, StrToTCHARz(string), -1, null, 0, null, null); … … 102 102 //startHTML 103 103 int start = buffer.toString().indexOf(NUMBER); 104 char[]temp = Integer.toString(startHTML);104 String temp = Integer.toString(startHTML); 105 105 buffer.select(start + maxLength-temp.length, temp.length); 106 106 buffer.replace(temp); … … 174 174 wchar[] lpWideCharStr = new wchar [cchWideChar - 1]; 175 175 OS.MultiByteToWideChar (codePage, OS.MB_PRECOMPOSED, lpMultiByteStr, -1, lpWideCharStr.ptr, lpWideCharStr.length); 176 char[]string = WCHARzToStr(lpWideCharStr.ptr);176 String string = WCHARzToStr(lpWideCharStr.ptr); 177 177 int fragmentStart = 0, fragmentEnd = 0; 178 178 int start = string.indexOf(StartFragment) + StartFragment.length; 179 179 int end = start + 1; 180 180 while (end < string.length) { 181 char[]s = string.substring(start, end);181 String s = string.substring(start, end); 182 182 try { 183 183 fragmentStart = Integer.parseInt(s); … … 190 190 end = start + 1; 191 191 while (end < string.length) { 192 char[]s = string.substring(start, end);192 String s = string.substring(start, end); 193 193 try { 194 194 fragmentEnd = Integer.parseInt(s); … … 203 203 * the wide char version of the byte stream. 204 204 */ 205 char[]s = string.substring(fragmentStart, fragmentEnd);205 String s = string.substring(fragmentStart, fragmentEnd); 206 206 /* 207 207 * Firefox includes <!--StartFragment --> in the fragment, so remove it. 208 208 */ 209 char[]foxStart = "<!--StartFragment -->\r\n"; //$NON-NLS-1$209 String foxStart = "<!--StartFragment -->\r\n"; //$NON-NLS-1$ 210 210 int prefix = s.indexOf(foxStart); 211 211 if (prefix !is -1) { … … 224 224 return [HTML_FORMATID]; 225 225 } 226 protected char[][] getTypeNames(){226 protected String[] getTypeNames(){ 227 227 return [HTML_FORMAT]; 228 228 }
