diff options
author | Felipe Heidrich <fheidric> | 2010-07-28 14:23:18 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2010-07-28 14:23:18 +0000 |
commit | 7d133b5e1b2b9e38f1e93c00fe21952f47daf9ab (patch) | |
tree | 23d0bf7e520b222d1002bee16c27123fcbac33a5 | |
parent | 01d5a686e1eee644477ad0fe7f43549d4d7efca1 (diff) | |
download | eclipse.platform.swt-7d133b5e1b2b9e38f1e93c00fe21952f47daf9ab.tar.gz eclipse.platform.swt-7d133b5e1b2b9e38f1e93c00fe21952f47daf9ab.tar.xz eclipse.platform.swt-7d133b5e1b2b9e38f1e93c00fe21952f47daf9ab.zip |
BACKPORT:Bug 318782 - [DataBinding] StringIndexOutOfBoundsException exception when clearing a Text with SWT.SEARCH
3 files changed, 3 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 d692fc38df..389aa23496 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 @@ -1269,6 +1269,7 @@ int /*long*/ gtk_delete_text (int /*long*/ widget, int /*long*/ start_pos, int / return 0; } if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0; + if (end_pos == -1) end_pos = OS.g_utf8_strlen (OS.gtk_entry_get_text (entryHandle), -1); String newText = verifyText ("", (int)/*64*/start_pos, (int)/*64*/end_pos); if (newText == null) { OS.g_signal_stop_emission_by_name (entryHandle, OS.delete_text); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java index c87d7cdf7b..d8c0dd1e50 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java @@ -647,6 +647,7 @@ int /*long*/ gtk_commit (int /*long*/ imContext, int /*long*/ text) { int /*long*/ gtk_delete_text (int /*long*/ widget, int /*long*/ start_pos, int /*long*/ end_pos) { if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0; + if (end_pos == -1) end_pos = OS.g_utf8_strlen (OS.gtk_entry_get_text (handle), -1); String newText = verifyText ("", (int)/*64*/start_pos, (int)/*64*/end_pos); if (newText == null) { OS.g_signal_stop_emission_by_name (handle, OS.delete_text); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index 3b107ce1ed..c62de0080d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -1256,6 +1256,7 @@ int /*long*/ gtk_delete_range (int /*long*/ widget, int /*long*/ iter1, int /*lo int /*long*/ gtk_delete_text (int /*long*/ widget, int /*long*/ start_pos, int /*long*/ end_pos) { if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0; + if (end_pos == -1) end_pos = OS.g_utf8_strlen (OS.gtk_entry_get_text (handle), -1); String newText = verifyText ("", (int)/*64*/start_pos, (int)/*64*/end_pos); if (newText == null) { /* Remember the selection when the text was deleted */ |