summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe>2008-05-14 17:11:13 +0000
committerBogdan Gheorghe <gheorghe>2008-05-14 17:11:13 +0000
commit238f5073d068c68377683fe890837e5610cfd291 (patch)
tree9ff83e876623706e8f1e3f006878d0146164ea9c /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
parenta0531845de6cc6b13e9665b27cef614e35b4a0db (diff)
downloadeclipse.platform.swt-238f5073d068c68377683fe890837e5610cfd291.tar.gz
eclipse.platform.swt-238f5073d068c68377683fe890837e5610cfd291.tar.xz
eclipse.platform.swt-238f5073d068c68377683fe890837e5610cfd291.zip
226007 BIDI3.4: search results appear shaped improperly
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
index 9be015cf4c..dd2f67119c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
@@ -160,6 +160,7 @@ void computeRuns () {
}
}
int strlen = OS.strlen(ptr);
+ Font defaultFont = font != null ? font : device.systemFont;
for (int i = 0; i < styles.length - 1; i++) {
StyleItem styleItem = styles[i];
TextStyle style = styleItem.style;
@@ -171,7 +172,7 @@ void computeRuns () {
byteStart = Math.min(byteStart, strlen);
byteEnd = Math.min(byteEnd, strlen);
Font font = style.font;
- if (font != null && !font.isDisposed()) {
+ if (font != null && !font.isDisposed() && !defaultFont.equals(font)) {
int /*long*/ attr = OS.pango_attr_font_desc_new (font.handle);
OS.memmove (attribute, attr, PangoAttribute.sizeof);
attribute.start_index = byteStart;
@@ -1763,6 +1764,7 @@ public void setFont (Font font) {
if (font != null && font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
Font oldFont = this.font;
if (oldFont == font) return;
+ freeRuns();
this.font = font;
if (oldFont != null && oldFont.equals(font)) return;
OS.pango_layout_set_font_description(layout, font != null ? font.handle : device.systemFont.handle);