Handle 0 increment, to fix division-by-zero problem. (#82816, George

Wed Jun 12 15:43:38 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkspinbutton.c (gtk_spin_button_snap): Handle
        0 increment, to fix division-by-zero problem.
        (#82816, George Lebl.)
This commit is contained in:
Owen Taylor 2002-06-12 19:42:48 +00:00 committed by Owen Taylor
parent a98888390a
commit f51ef574b5
7 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,9 @@
Wed Jun 12 15:43:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkspinbutton.c (gtk_spin_button_snap): Handle
0 increment, to fix division-by-zero problem.
(#82816, George Lebl.)
Wed Jun 12 15:38:01 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):

View File

@ -1,3 +1,9 @@
Wed Jun 12 15:43:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkspinbutton.c (gtk_spin_button_snap): Handle
0 increment, to fix division-by-zero problem.
(#82816, George Lebl.)
Wed Jun 12 15:38:01 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):

View File

@ -1,3 +1,9 @@
Wed Jun 12 15:43:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkspinbutton.c (gtk_spin_button_snap): Handle
0 increment, to fix division-by-zero problem.
(#82816, George Lebl.)
Wed Jun 12 15:38:01 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):

View File

@ -1,3 +1,9 @@
Wed Jun 12 15:43:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkspinbutton.c (gtk_spin_button_snap): Handle
0 increment, to fix division-by-zero problem.
(#82816, George Lebl.)
Wed Jun 12 15:38:01 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):

View File

@ -1,3 +1,9 @@
Wed Jun 12 15:43:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkspinbutton.c (gtk_spin_button_snap): Handle
0 increment, to fix division-by-zero problem.
(#82816, George Lebl.)
Wed Jun 12 15:38:01 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):

View File

@ -1,3 +1,9 @@
Wed Jun 12 15:43:38 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkspinbutton.c (gtk_spin_button_snap): Handle
0 increment, to fix division-by-zero problem.
(#82816, George Lebl.)
Wed Jun 12 15:38:01 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (gtk_im_multicontext_append_menuitems):

View File

@ -1318,6 +1318,9 @@ gtk_spin_button_snap (GtkSpinButton *spin_button,
gdouble tmp;
inc = spin_button->adjustment->step_increment;
if (inc == 0)
return;
tmp = (val - spin_button->adjustment->lower) / inc;
if (tmp - floor (tmp) < ceil (tmp) - tmp)
val = spin_button->adjustment->lower + floor (tmp) * inc;