summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authory29cheng2011-09-21 13:01:14 (EDT)
committer Felipe Heidrich2011-10-07 12:27:26 (EDT)
commit2d0e3fd644ae17132269c275bfaea2711be8ebfb (patch)
tree963deaeab0d7225234940d94eb1cf9dbd7a520fc
parentcebc16d81346a5671fdfc70a34e4dcf0a308418a (diff)
downloadeclipse.platform.swt-2d0e3fd644ae17132269c275bfaea2711be8ebfb.zip
eclipse.platform.swt-2d0e3fd644ae17132269c275bfaea2711be8ebfb.tar.gz
eclipse.platform.swt-2d0e3fd644ae17132269c275bfaea2711be8ebfb.tar.bz2
Bug 44072
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java6
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 1c63f47..43b062f 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));
}