mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
Avoid a crash when setting a tooltip on a GtkCalendar
The details code was assuming that it controls ::has-tooltip. Reported by Bill Nottingham, bug 607344.
This commit is contained in:
parent
beddf67e56
commit
412beb4444
@ -1679,6 +1679,9 @@ gtk_calendar_get_detail (GtkCalendar *calendar,
|
||||
GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
|
||||
gint year, month;
|
||||
|
||||
if (priv->detail_func == NULL)
|
||||
return NULL;
|
||||
|
||||
year = calendar->year;
|
||||
month = calendar->month + calendar->day_month[row][column] - MONTH_CURRENT;
|
||||
|
||||
@ -2494,10 +2497,7 @@ calendar_paint_day (GtkCalendar *calendar,
|
||||
|
||||
/* Get extra information to show, if any: */
|
||||
|
||||
if (priv->detail_func)
|
||||
detail = gtk_calendar_get_detail (calendar, row, col);
|
||||
else
|
||||
detail = NULL;
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, buffer);
|
||||
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
|
||||
|
Loading…
Reference in New Issue
Block a user