Mercurial > projects > dwt-linux
comparison dwt/custom/StyledText.d @ 238:380bad9f6852
reverted char[] to String
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:42:55 +0200 |
parents | 19ce131cbd99 |
children | ce446666f5a2 |
comparison
equal
deleted
inserted
replaced
237:98b80b00af79 | 238:380bad9f6852 |
---|---|
849 // to the current one. Fixes bug 21698. | 849 // to the current one. Fixes bug 21698. |
850 if (index > start) { | 850 if (index > start) { |
851 write( string[start .. index ] ); | 851 write( string[start .. index ] ); |
852 } | 852 } |
853 write("\\u"); | 853 write("\\u"); |
854 write( to!(char[])( cast(short)ch )); | 854 write( to!(String)( cast(short)ch )); |
855 write(' '); // control word delimiter | 855 write(' '); // control word delimiter |
856 start = index + incr; | 856 start = index + incr; |
857 } else if (ch is '}' || ch is '{' || ch is '\\') { | 857 } else if (ch is '}' || ch is '{' || ch is '\\') { |
858 // write the sub string from the last escaped character | 858 // write the sub string from the last escaped character |
859 // to the current one. Fixes bug 21698. | 859 // to the current one. Fixes bug 21698. |
878 StringBuffer header = new StringBuffer(); | 878 StringBuffer header = new StringBuffer(); |
879 FontData fontData = getFont().getFontData()[0]; | 879 FontData fontData = getFont().getFontData()[0]; |
880 header.append("{\\rtf1\\ansi"); | 880 header.append("{\\rtf1\\ansi"); |
881 // specify code page, necessary for copy to work in bidi | 881 // specify code page, necessary for copy to work in bidi |
882 // systems that don't support Unicode RTF. | 882 // systems that don't support Unicode RTF. |
883 // PORTING_TODO: char[] cpg = System.getProperty("file.encoding").toLowerCase(); | 883 // PORTING_TODO: String cpg = System.getProperty("file.encoding").toLowerCase(); |
884 char[] cpg = "UTF16"; | 884 String cpg = "UTF16"; |
885 /+ | 885 /+ |
886 if (cpg.startsWith("cp") || cpg.startsWith("ms")) { | 886 if (cpg.startsWith("cp") || cpg.startsWith("ms")) { |
887 cpg = cpg.substring(2, cpg.length()); | 887 cpg = cpg.substring(2, cpg.length()); |
888 header.append("\\ansicpg"); | 888 header.append("\\ansicpg"); |
889 header.append(cpg); | 889 header.append(cpg); |