From 2d0e3fd644ae17132269c275bfaea2711be8ebfb Mon Sep 17 00:00:00 2001 From: y29cheng Date: Wed, 21 Sep 2011 13:01:14 -0400 Subject: Bug 44072 --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index 1c63f471a5..43b062f25f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -843,6 +843,9 @@ GdkColor getBackgroundColor () { public Point getCaretLocation() { checkWidget(); + if((style & SWT.READ_ONLY) != 0) { + return new Point(0, 0); + } int index = OS.gtk_editable_get_position (entryHandle); if (OS.GTK_VERSION >= OS.VERSION (2, 6, 0)) { index = OS.gtk_entry_text_index_to_layout_index (entryHandle, index); @@ -859,6 +862,9 @@ public Point getCaretLocation() { public int getCaretPosition() { checkWidget(); + if((style & SWT.READ_ONLY) != 0) { + return 0; + } int /*long*/ ptr = OS.gtk_entry_get_text (entryHandle); return (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, OS.gtk_editable_get_position (entryHandle)); } -- cgit v1.2.3