diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-07-12 09:42:39 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-07-12 09:42:39 -0400 |
commit | c9f7838af1e54e39107b4e5302048b7cebef9023 (patch) | |
tree | a58c3eb488c1afdf705c0c98922bb9c67006ef1d /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | e3a2594d93baac57c5e342d2c7769e2b4dd79d71 (diff) | |
download | eclipse.platform.swt-c9f7838af1e54e39107b4e5302048b7cebef9023.tar.gz eclipse.platform.swt-c9f7838af1e54e39107b4e5302048b7cebef9023.tar.xz eclipse.platform.swt-c9f7838af1e54e39107b4e5302048b7cebef9023.zip |
Bug 376560 - Crash when starting on SUSE or some RHEL4 - Comment#11
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java | 28 |
1 files changed, 16 insertions, 12 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 c0f4ff32a7..67695a3d5d 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 @@ -240,12 +240,14 @@ void computeRuns () { if (style.underlineColor != null) { GdkColor fg = style.underlineColor.handle; attr = OS.pango_attr_underline_color_new(fg.red, fg.green, fg.blue); - OS.memmove(attribute, attr, PangoAttribute.sizeof); - attribute.start_index = byteStart; - attribute.end_index = byteEnd; - OS.memmove(attr, attribute, PangoAttribute.sizeof); - OS.pango_attr_list_insert(attrList, attr); - OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr)); + if (attr != 0) { + OS.memmove(attribute, attr, PangoAttribute.sizeof); + attribute.start_index = byteStart; + attribute.end_index = byteEnd; + OS.memmove(attr, attribute, PangoAttribute.sizeof); + OS.pango_attr_list_insert(attrList, attr); + OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr)); + } } } if (style.strikeout) { @@ -259,12 +261,14 @@ void computeRuns () { if (style.strikeoutColor != null) { GdkColor fg = style.strikeoutColor.handle; attr = OS.pango_attr_strikethrough_color_new(fg.red, fg.green, fg.blue); - OS.memmove(attribute, attr, PangoAttribute.sizeof); - attribute.start_index = byteStart; - attribute.end_index = byteEnd; - OS.memmove(attr, attribute, PangoAttribute.sizeof); - OS.pango_attr_list_insert(attrList, attr); - OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr)); + if (attr != 0) { + OS.memmove(attribute, attr, PangoAttribute.sizeof); + attribute.start_index = byteStart; + attribute.end_index = byteEnd; + OS.memmove(attr, attribute, PangoAttribute.sizeof); + OS.pango_attr_list_insert(attrList, attr); + OS.pango_attr_list_insert(selAttrList, OS.pango_attribute_copy(attr)); + } } } Color foreground = style.foreground; |