summaryrefslogtreecommitdiffstats
path: root/bundles
diff options
context:
space:
mode:
authorKevin Barnes <krbarnes>2008-08-25 19:46:14 +0000
committerKevin Barnes <krbarnes>2008-08-25 19:46:14 +0000
commit9d80fa41aebed8140fd6eb7eab6449cb2fe17efe (patch)
tree6251164124c7b9c11732b405392bc329f6c892c1 /bundles
parentf027e65f362a4197ce516f6998da11767ff4ed6f (diff)
downloadeclipse.platform.swt-9d80fa41aebed8140fd6eb7eab6449cb2fe17efe.tar.gz
eclipse.platform.swt-9d80fa41aebed8140fd6eb7eab6449cb2fe17efe.tar.xz
eclipse.platform.swt-9d80fa41aebed8140fd6eb7eab6449cb2fe17efe.zip
put back DRAW_MNEMONIC and DRAW_DELIMITER code
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java70
1 files changed, 35 insertions, 35 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
index 1a4c570cd5..539aec6c4a 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
@@ -635,41 +635,41 @@ NSAttributedString createString(String string, int flags) {
int length = string.length();
char[] chars = new char[length];
string.getChars(0, length, chars, 0);
-// int breakCount = 0;
-// int[] breaks = null;
-// if ((flags & (SWT.DRAW_MNEMONIC | SWT.DRAW_DELIMITER)) != 0) {
-// int i=0, j=0;
-// while (i < chars.length) {
-// char c = chars [j++] = chars [i++];
-// switch (c) {
-// case '&': {
-// if ((flags & SWT.DRAW_MNEMONIC) != 0) {
-// if (i == chars.length) {continue;}
-// if (chars [i] == '&') {i++; continue;}
-// j--;
-// }
-// break;
-// }
-// case '\r':
-// case '\n': {
-// if ((flags & SWT.DRAW_DELIMITER) != 0) {
-// if (c == '\r' && i != chars.length && chars[i] == '\n') i++;
-// j--;
-// if (breaks == null) {
-// breaks = new int[4];
-// } else if (breakCount == breaks.length) {
-// int[] newBreaks = new int[breaks.length + 4];
-// System.arraycopy(breaks, 0, newBreaks, 0, breaks.length);
-// breaks = newBreaks;
-// }
-// breaks[breakCount++] = j;
-// }
-// break;
-// }
-// }
-// }
-// length = j;
-// }
+ int breakCount = 0;
+ int[] breaks = null;
+ if ((flags & (SWT.DRAW_MNEMONIC | SWT.DRAW_DELIMITER)) != 0) {
+ int i=0, j=0;
+ while (i < chars.length) {
+ char c = chars [j++] = chars [i++];
+ switch (c) {
+ case '&': {
+ if ((flags & SWT.DRAW_MNEMONIC) != 0) {
+ if (i == chars.length) {continue;}
+ if (chars [i] == '&') {i++; continue;}
+ j--;
+ }
+ break;
+ }
+ case '\r':
+ case '\n': {
+ if ((flags & SWT.DRAW_DELIMITER) != 0) {
+ if (c == '\r' && i != chars.length && chars[i] == '\n') i++;
+ j--;
+ if (breaks == null) {
+ breaks = new int[4];
+ } else if (breakCount == breaks.length) {
+ int[] newBreaks = new int[breaks.length + 4];
+ System.arraycopy(breaks, 0, newBreaks, 0, breaks.length);
+ breaks = newBreaks;
+ }
+ breaks[breakCount++] = j;
+ }
+ break;
+ }
+ }
+ }
+ length = j;
+ }
NSString str = NSString.stringWithCharacters(chars, length);
return ((NSAttributedString)new NSAttributedString().alloc()).initWithString(str, dict);
}