diff options
author | y29cheng <y29cheng@gmail.com> | 2011-09-21 13:01:14 -0400 |
---|---|---|
committer | Felipe Heidrich <Felipe_Heidrich@ca.ibm.com> | 2011-10-07 12:27:26 -0400 |
commit | 2d0e3fd644ae17132269c275bfaea2711be8ebfb (patch) | |
tree | 963deaeab0d7225234940d94eb1cf9dbd7a520fc /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | |
parent | cebc16d81346a5671fdfc70a34e4dcf0a308418a (diff) | |
download | eclipse.platform.swt-2d0e3fd644ae17132269c275bfaea2711be8ebfb.tar.gz eclipse.platform.swt-2d0e3fd644ae17132269c275bfaea2711be8ebfb.tar.xz eclipse.platform.swt-2d0e3fd644ae17132269c275bfaea2711be8ebfb.zip |
Bug 44072
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 6 |
1 files changed, 6 insertions, 0 deletions
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)); } |