diff options
author | Tim Janik <timj@gimp.org> | 1998-03-12 07:28:41 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-03-12 07:28:41 +0000 |
commit | a8afd462c0d23eb1fed39394a523b364a4cdca39 (patch) | |
tree | 968bce7fcef1d8bdbb9dd2750d013701364650e7 /gtk/gtkspinbutton.c | |
parent | 093dfedf74d607085b163bd254dea8682d0ba774 (diff) | |
download | gtk+-a8afd462c0d23eb1fed39394a523b364a4cdca39.tar.gz |
applied gtk-shige-980311-0.patch.gz, which removes the erronerous
Thu Mar 12 07:43:33 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.h:
* gdk/gdkvisual.c: applied gtk-shige-980311-0.patch.gz, which removes
the erronerous gdk_query_visuals() function in favour of
gdk_list_visuals() which does a correct job.
* gtk/gtkcontainer.h: applied gtk-draco-980311-0.patch.gz which fixes
a class cast check.
* gtk/gtkspinbutton.c: applied gtk-hamann_jeske-980312-0.patch.gz about
'+' sign acceptance.
* gtk/gtknotebook.c: applied gtk-hamann_jeske-980311-1.patch.gz which
cares about delayed tab label creation.
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r-- | gtk/gtkspinbutton.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index beffd0a9c5..db6149fa1a 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -1049,14 +1049,28 @@ gtk_spin_button_insert_text (GtkEditable *editable, if (spin->numeric) { struct lconv *lc; - gboolean minus; + gboolean sign; gint dotpos = -1; gint i; + gchar pos_sign; + gchar neg_sign; lc = localeconv (); - minus = (strchr (entry->text, *(lc->negative_sign)) != 0) ; - if (minus && !(*position)) + if (*(lc->negative_sign)) + neg_sign = *(lc->negative_sign); + else + neg_sign = '-'; + + if (*(lc->positive_sign)) + pos_sign = *(lc->positive_sign); + else + pos_sign = '+'; + + sign = ((strchr (entry->text, neg_sign) != 0) || + (strchr (entry->text, pos_sign) != 0)); + + if (sign && !(*position)) return; dotpos = strchr (entry->text, *(lc->decimal_point)) - entry->text; @@ -1067,11 +1081,11 @@ gtk_spin_button_insert_text (GtkEditable *editable, for (i = 0; i < new_text_length; i++) { - if (new_text[i] == *(lc->negative_sign)) + if (new_text[i] == neg_sign || new_text[i] == pos_sign) { - if (minus || (*position) || i) + if (sign || (*position) || i) return; - minus = TRUE; + sign = TRUE; } else if (new_text[i] == *(lc->decimal_point)) { |