summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2008-05-07 22:59:19 +0000
committerFelipe Heidrich <fheidric>2008-05-07 22:59:19 +0000
commit327cb8a0756a7500d931cd29b5b822c2051a4343 (patch)
tree0722551ede9984785194b16a0c24603977ac16a0 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
parent8e217d94a994e2c6c6f614cf598e52417851a3a7 (diff)
downloadeclipse.platform.swt-327cb8a0756a7500d931cd29b5b822c2051a4343.tar.gz
eclipse.platform.swt-327cb8a0756a7500d931cd29b5b822c2051a4343.tar.xz
eclipse.platform.swt-327cb8a0756a7500d931cd29b5b822c2051a4343.zip
Bug 231009 Compile Error on GTK 2.2.x: Fields missing from PangoLayoutLine
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 0c3262f6ad..b5d082bc38 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -381,12 +381,13 @@ public void setAlignment (int alignment) {
void setAlignment () {
boolean isRTL = (style & SWT.RIGHT_TO_LEFT) != 0;
if (text != null && text.length () != 0) {
- int /*long*/ layout = OS.gtk_label_get_layout (labelHandle);
- int /*long*/ linePtr = OS.pango_layout_get_line (layout, 0);
- PangoLayoutLine line = new PangoLayoutLine ();
- OS.memmove (line, linePtr, PangoLayoutLine.sizeof);
- if (line.resolved_dir == OS.PANGO_DIRECTION_RTL) {
- isRTL = !isRTL;
+ if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0)) {
+ int /*long*/ layout = OS.gtk_label_get_layout (labelHandle);
+ int /*long*/ linePtr = OS.pango_layout_get_line (layout, 0);
+ int resolved_dir = OS.pango_layout_line_get_resolved_dir (linePtr);
+ if (resolved_dir == OS.PANGO_DIRECTION_RTL) {
+ isRTL = !isRTL;
+ }
}
}
if ((style & SWT.LEFT) != 0) {