summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2008-01-15 15:51:26 +0000
committerFelipe Heidrich <fheidric>2008-01-15 15:51:26 +0000
commit0f7ca39e5aaeb45d932701984ad32860f1a39afd (patch)
treea6f1b6b88f06d3fd3177536c5cd5e6328822012a /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
parentb72f4da54c4730cb476a2890ad4890284e3196ef (diff)
downloadeclipse.platform.swt-0f7ca39e5aaeb45d932701984ad32860f1a39afd.tar.gz
eclipse.platform.swt-0f7ca39e5aaeb45d932701984ad32860f1a39afd.tar.xz
eclipse.platform.swt-0f7ca39e5aaeb45d932701984ad32860f1a39afd.zip
don't accept + (part of Bug 91317)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java14
1 files changed, 7 insertions, 7 deletions
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 0180ccb49f..0df3ba0dc2 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
@@ -1067,14 +1067,14 @@ String verifyText (String string, int start, int end) {
}
index = 0;
}
- int /*long*/ hAdjustment = OS.gtk_spin_button_get_adjustment (handle);
- GtkAdjustment adjustment = new GtkAdjustment ();
- OS.memmove (adjustment, hAdjustment);
- boolean minNegative = adjustment.lower < 0;
- boolean maxPositive = adjustment.upper > 0;
+ if (string.length () > 0) {
+ int /*long*/ hAdjustment = OS.gtk_spin_button_get_adjustment (handle);
+ GtkAdjustment adjustment = new GtkAdjustment ();
+ OS.memmove (adjustment, hAdjustment);
+ if (adjustment.lower < 0 && string.charAt (0) == '-') index++;
+ }
while (index < string.length ()) {
- char ch = string.charAt (index);
- if (!(Character.isDigit (ch) || (minNegative && ch == '-') || (maxPositive && ch == '+'))) break;
+ if (!Character.isDigit (string.charAt (index))) break;
index++;
}
event.doit = index == string.length ();