diff options
author | Felipe Heidrich <fheidric> | 2003-09-26 21:03:22 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2003-09-26 21:03:22 +0000 |
commit | 09e5ed64143690d758a0bcb5dbe9135f872f4472 (patch) | |
tree | bfb3eec6f41d60b6768d564458dfc3f8529e3818 | |
parent | 8d2bd8d7d7cb0014d46059a4dd6ad41a4a7bc280 (diff) | |
download | eclipse.platform.swt-09e5ed64143690d758a0bcb5dbe9135f872f4472.tar.gz eclipse.platform.swt-09e5ed64143690d758a0bcb5dbe9135f872f4472.tar.xz eclipse.platform.swt-09e5ed64143690d758a0bcb5dbe9135f872f4472.zip |
*** empty log message ***
6 files changed, 18 insertions, 17 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java index 62df71cda6..0a7dc420e6 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/win32/org/eclipse/swt/printing/Printer.java @@ -229,9 +229,10 @@ public int internal_new_GC(GCData data) { if (data != null) { if (isGCCreated) SWT.error(SWT.ERROR_INVALID_ARGUMENT); int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; - if ((data.style & mask) == 0) { + if ((data.style & mask) != 0) { + data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0; + } else { data.style |= SWT.LEFT_TO_RIGHT; - data.layout = -1; } data.device = this; data.hFont = OS.GetCurrentObject(handle, OS.OBJ_FONT); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java index 55a276753e..89b8f36e72 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java @@ -1984,16 +1984,13 @@ void init(Drawable drawable, GCData data, int hDC) { int layout = data.layout; if (layout != -1) { if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) { - if ((data.style & SWT.RIGHT_TO_LEFT) != 0) { - data.style |= SWT.MIRRORED; - layout = OS.LAYOUT_RTL; - } int flags = OS.GetLayout(hDC); - if ((flags & OS.LAYOUT_RTL) != layout) { + if ((flags & OS.LAYOUT_RTL) != (layout & OS.LAYOUT_RTL)) { flags &= ~OS.LAYOUT_RTL; OS.SetLayout(hDC, flags | layout); } - } + if ((data.style & SWT.RIGHT_TO_LEFT) != 0) data.style |= SWT.MIRRORED; + } } this.drawable = drawable; this.data = data; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java index 27647a127d..8d530bbbb3 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GCData.java @@ -34,5 +34,5 @@ public final class GCData { public int hNullBitmap; public int hwnd; public PAINTSTRUCT ps; - public int layout; + public int layout = -1; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java index 37406a3398..6ad92ca258 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java @@ -1758,9 +1758,10 @@ public int internal_new_GC (GCData data) { if (data != null) { /* Set the GCData fields */ int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; - if ((data.style & mask) == 0) { + if ((data.style & mask) != 0) { + data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0; + } else { data.style |= SWT.LEFT_TO_RIGHT; - data.layout = -1; } data.device = device; data.image = this; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index bbd4a9ddbd..dc0b14f966 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -1017,14 +1017,15 @@ public int internal_new_GC (GCData data) { if (hDC == 0) SWT.error(SWT.ERROR_NO_HANDLES); if (data != null) { int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; - if ((data.style & mask) == 0) { - int bits = OS.GetWindowLong (handle, OS.GWL_EXSTYLE); - if ((bits & OS.WS_EX_LAYOUTRTL) != 0) { + if ((data.style & mask) != 0) { + data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0; + } else { + int flags = OS.GetLayout (hDC); + if ((flags & OS.LAYOUT_RTL) != 0) { data.style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED; } else { data.style |= SWT.LEFT_TO_RIGHT; } - data.layout = -1; } data.device = getDisplay (); data.foreground = getForegroundPixel (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java index e44cfffa02..36ce482baa 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java @@ -1292,9 +1292,10 @@ public int internal_new_GC (GCData data) { if (hDC == 0) SWT.error (SWT.ERROR_NO_HANDLES); if (data != null) { int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; - if ((data.style & mask) == 0) { + if ((data.style & mask) != 0) { + data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0; + } else { data.style |= SWT.LEFT_TO_RIGHT; - data.layout = -1; } data.device = this; data.hFont = systemFont (); |