summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barnes <krbarnes>2009-08-13 20:08:46 +0000
committerKevin Barnes <krbarnes>2009-08-13 20:08:46 +0000
commit7082819ddb2d2fd61855af853d579405a1b64430 (patch)
tree10f8bbc37fa2d7aa7182e238c9ef8e0cd3623c3c
parent179cf5d8c93d6ba03bc4e339bbc976336e8bfba5 (diff)
downloadeclipse.platform.swt-7082819ddb2d2fd61855af853d579405a1b64430.tar.gz
eclipse.platform.swt-7082819ddb2d2fd61855af853d579405a1b64430.tar.xz
eclipse.platform.swt-7082819ddb2d2fd61855af853d579405a1b64430.zip
276110 - Label: SWT.CENTER is being ignored when used with SWT.WRAP
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java12
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java2
10 files changed, 17 insertions, 17 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
index c6386e25a4..366a01fe2b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
@@ -208,7 +208,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
}
NSAttributedString createString() {
- NSAttributedString attribStr = createString(text, null, foreground, style, true, true);
+ NSAttributedString attribStr = createString(text, null, foreground, style, false, true, true);
attribStr.autorelease();
return attribStr;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index 437cca8e5b..d6c563798c 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -806,7 +806,7 @@ NSView contentView () {
return view;
}
-NSAttributedString createString (String string, Font font, float /*double*/ [] foreground, int style, boolean enabled, boolean mnemonics) {
+NSAttributedString createString (String string, Font font, float /*double*/ [] foreground, int style, boolean wrap, boolean enabled, boolean mnemonics) {
NSMutableDictionary dict = ((NSMutableDictionary)new NSMutableDictionary().alloc()).initWithCapacity(5);
if (font == null) font = this.font != null ? this.font : defaultFont();
dict.setObject (font.handle, OS.NSFontAttributeName);
@@ -819,9 +819,9 @@ NSAttributedString createString (String string, Font font, float /*double*/ [] f
} else {
dict.setObject (NSColor.disabledControlTextColor (), OS.NSForegroundColorAttributeName);
}
+ NSMutableParagraphStyle paragraphStyle = (NSMutableParagraphStyle)new NSMutableParagraphStyle ().alloc ().init ();
+ paragraphStyle.setLineBreakMode (wrap ? OS.NSLineBreakByWordWrapping : OS.NSLineBreakByClipping);
if (style != 0) {
- NSMutableParagraphStyle paragraphStyle = (NSMutableParagraphStyle)new NSMutableParagraphStyle ().alloc ().init ();
- paragraphStyle.setLineBreakMode (OS.NSLineBreakByClipping);
int alignment = SWT.LEFT;
if ((style & SWT.CENTER) != 0) {
alignment = OS.NSCenterTextAlignment;
@@ -829,9 +829,9 @@ NSAttributedString createString (String string, Font font, float /*double*/ [] f
alignment = OS.NSRightTextAlignment;
}
paragraphStyle.setAlignment (alignment);
- dict.setObject (paragraphStyle, OS.NSParagraphStyleAttributeName);
- paragraphStyle.release ();
}
+ dict.setObject (paragraphStyle, OS.NSParagraphStyleAttributeName);
+ paragraphStyle.release ();
int length = string.length ();
char [] chars = new char [length];
string.getChars (0, chars.length, chars, 0);
@@ -3764,7 +3764,7 @@ void sort (int [] items) {
}
NSSize textExtent (String string) {
- NSAttributedString attribStr = createString(string, null, null, 0, true, false);
+ NSAttributedString attribStr = createString(string, null, null, 0, false, true, false);
NSSize size = attribStr.size();
attribStr.release();
return size;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
index 2afd1625e8..b541921629 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
@@ -255,7 +255,7 @@ void createWidget() {
}
NSAttributedString createString() {
- NSAttributedString attribStr = createString(text, null, foreground, (style & SWT.WRAP) == 0 ? style : 0, true, true);
+ NSAttributedString attribStr = createString(text, null, foreground, style, (style & SWT.WRAP) != 0, true, true);
attribStr.autorelease();
return attribStr;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
index bb3c565101..daacca2e56 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
@@ -1437,7 +1437,7 @@ boolean tableView_shouldEditTableColumn_row(int /*long*/ id, int /*long*/ sel, i
}
int /*long*/ tableView_objectValueForTableColumn_row(int /*long*/ id, int /*long*/ sel, int /*long*/ aTableView, int /*long*/ aTableColumn, int /*long*/ rowIndex) {
- NSAttributedString attribStr = createString(items[(int)/*64*/rowIndex], null, foreground, 0, true, false);
+ NSAttributedString attribStr = createString(items[(int)/*64*/rowIndex], null, foreground, 0, false, true, false);
attribStr.autorelease();
return attribStr.id;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
index 6c53ac470b..553f1a8440 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
@@ -208,7 +208,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
float /*double*/ width = 0, height = 0;
String string = Double.toString (buttonView.maxValue ());
Font font = Font.cocoa_new(display, textView.font ());
- NSAttributedString str = parent.createString(string, font, null, 0, true, false);
+ NSAttributedString str = parent.createString(string, font, null, 0, false, true, false);
NSSize size = str.size ();
str.release ();
width = (float)/*64*/size.width;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
index 8bfd6587e4..72c5e64adc 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
@@ -222,7 +222,7 @@ void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect cel
NSTableHeaderCell headerCell = nsColumn.headerCell ();
if (displayText != null) {
Font font = Font.cocoa_new(display, headerCell.font ());
- attrString = parent.createString(displayText, font, null, SWT.LEFT, (parent.state & DISABLED) == 0, false);
+ attrString = parent.createString(displayText, font, null, SWT.LEFT, false, (parent.state & DISABLED) == 0, false);
stringSize = attrString.size ();
contentWidth += Math.ceil (stringSize.width);
if (image != null) contentWidth += MARGIN; /* space between image and text */
@@ -422,7 +422,7 @@ public void pack () {
if (displayText != null) {
NSTableHeaderCell headerCell = nsColumn.headerCell ();
Font font = Font.cocoa_new(display, headerCell.font ());
- NSAttributedString attrString = parent.createString(displayText, font, null, 0, true, false);
+ NSAttributedString attrString = parent.createString(displayText, font, null, 0, false, true, false);
NSSize stringSize = attrString.size ();
attrString.release ();
width += Math.ceil (stringSize.width);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
index fb5a144c3d..e3ed6ab93e 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
@@ -136,7 +136,7 @@ int calculateWidth (int index, GC gc) {
Image image = index == 0 ? this.image : (images == null ? null : images [index]);
NSCell cell = parent.dataCell;
if (font.extraTraits != 0) {
- NSAttributedString attribStr = parent.createString(text, font, null, 0, true, false);
+ NSAttributedString attribStr = parent.createString(text, font, null, 0, false, true, false);
cell.setAttributedStringValue(attribStr);
attribStr.release();
} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
index 21853d587f..a9d27141a2 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
@@ -279,7 +279,7 @@ void createHandle () {
}
NSAttributedString createString() {
- NSAttributedString attribStr = parent.createString(text, null, parent.foreground, SWT.CENTER, true, true);
+ NSAttributedString attribStr = parent.createString(text, null, parent.foreground, SWT.CENTER, false, true, true);
attribStr.autorelease();
return attribStr;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
index ed0180f373..94cc88d8d1 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
@@ -224,7 +224,7 @@ void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect cel
NSTableHeaderCell headerCell = nsColumn.headerCell ();
if (displayText != null) {
Font font = Font.cocoa_new(display, headerCell.font ());
- attrString = parent.createString(displayText, font, null, SWT.LEFT, (parent.state & DISABLED) == 0, false);
+ attrString = parent.createString(displayText, font, null, SWT.LEFT, false, (parent.state & DISABLED) == 0, false);
stringSize = attrString.size ();
contentWidth += Math.ceil (stringSize.width);
if (image != null) contentWidth += MARGIN; /* space between image and text */
@@ -424,7 +424,7 @@ public void pack () {
if (displayText != null) {
NSTableHeaderCell headerCell = nsColumn.headerCell ();
Font font = Font.cocoa_new(display, headerCell.font ());
- NSAttributedString attrString = parent.createString(displayText, font, null, 0, true, false);
+ NSAttributedString attrString = parent.createString(displayText, font, null, 0, false, true, false);
NSSize stringSize = attrString.size ();
attrString.release ();
width += Math.ceil (stringSize.width);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
index 035627d722..6f090d9cb3 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
@@ -239,7 +239,7 @@ int calculateWidth (int index, GC gc) {
Image image = index == 0 ? this.image : (images == null ? null : images [index]);
NSCell cell = parent.dataCell;
if (font.extraTraits != 0) {
- NSAttributedString attribStr = parent.createString(text, font, null, 0, true, false);
+ NSAttributedString attribStr = parent.createString(text, font, null, 0, false, true, false);
cell.setAttributedStringValue(attribStr);
attribStr.release();
} else {