comparison src/window.c @ 3687:719ceea8b3cb

[xemacs-hg @ 2006-11-18 18:17:53 by michaels] 2006-11-18 Mike Sperber <mike@xemacs.org> * window.c (window_pixel_height_to_char_height): Cater to the possibility that defheight may be 0.
author michaels
date Sat, 18 Nov 2006 18:17:55 +0000
parents 3ef0aaf3dc34
children f6f6fc9eb269
comparison
equal deleted inserted replaced
3686:5bab930875e2 3687:719ceea8b3cb
4105 window_pixel_height_to_char_height (struct window *w, int pixel_height, 4105 window_pixel_height_to_char_height (struct window *w, int pixel_height,
4106 int include_gutters_p) 4106 int include_gutters_p)
4107 { 4107 {
4108 int avail_height; 4108 int avail_height;
4109 int defheight, defwidth; 4109 int defheight, defwidth;
4110 int char_height; 4110 int char_height = 0;
4111 Lisp_Object window = wrap_window (w); 4111 Lisp_Object window = wrap_window (w);
4112 4112
4113 4113
4114 avail_height = (pixel_height - 4114 avail_height = (pixel_height -
4115 (include_gutters_p ? 0 : 4115 (include_gutters_p ? 0 :
4116 window_top_window_gutter_height (w) + 4116 window_top_window_gutter_height (w) +
4117 window_bottom_window_gutter_height (w))); 4117 window_bottom_window_gutter_height (w)));
4118 4118
4119 default_face_height_and_width (window, &defheight, &defwidth); 4119 default_face_height_and_width (window, &defheight, &defwidth);
4120 4120
4121 char_height = avail_height / defheight; 4121 if (defheight)
4122 char_height = avail_height / defheight;
4122 4123
4123 /* It's the calling function's responsibility to check these values 4124 /* It's the calling function's responsibility to check these values
4124 and make sure they're not out of range. 4125 and make sure they're not out of range.
4125 4126
4126 #### We need to go through the calling functions and actually 4127 #### We need to go through the calling functions and actually