summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-02-08 21:18:13 -0500
committerMatthias Clasen <mclasen@redhat.com>2010-02-09 13:41:58 -0500
commit412beb444440c01e2e2558cd0d20dac0fc1d9a69 (patch)
treeffb6e79958590b3a5e4dd24da9bea2f9ea794cb7 /gtk
parentbeddf67e562e1670d692cb9ba0a2546713cc80fc (diff)
downloadgtk+-412beb444440c01e2e2558cd0d20dac0fc1d9a69.tar.gz
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.
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkcalendar.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 8bc6e63cfe..13488e50a2 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -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;
+ detail = gtk_calendar_get_detail (calendar, row, col);
layout = gtk_widget_create_pango_layout (widget, buffer);
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);