From 820e1591fd4d6248dbea6d9e2b010373299cbaf5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 1 Oct 2007 07:26:27 +0000 Subject: 2007-10-01 mcrha Fix for bug #230339 svn path=/trunk/; revision=34338 --- calendar/ChangeLog | 6 ++++++ calendar/gui/print.c | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 349cd18036..026e2f3ae5 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2007-10-01 Milan Crha + + ** Fix for bug #230339 + + * gui/print.c: (print_day_event): Print also location, if present. + 2007-09-27 Hiroyuki Ikezoe ** Fix for bug #461195 diff --git a/calendar/gui/print.c b/calendar/gui/print.c index e1f07de8aa..845ae146ba 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -1040,7 +1040,7 @@ print_day_event (GtkPrintContext *context, PangoFontDescription *font, double left, double right, double top, double bottom, EDayViewEvent *event, struct pdinfo *pdi, ECalModel *model) { - const gchar *summary; + const gchar *summary, *location; double x1, x2, y1, y2, col_width, row_height; int start_offset, end_offset, start_row, end_row; char *text, start_buffer[32], end_buffer[32]; @@ -1082,9 +1082,16 @@ print_day_event (GtkPrintContext *context, PangoFontDescription *font, summary = icalcomponent_get_summary (event->comp_data->icalcomp); text = summary ? (char*) summary : ""; - + + location = icalcomponent_get_location (event->comp_data->icalcomp); + if (location && *location) { + text = g_strdup_printf ("%s (%s)", text, location); + free_text = TRUE; + } if (display_times) { + gchar *t = NULL; + date_tm.tm_year = 2001; date_tm.tm_mon = 0; date_tm.tm_mday = 1; @@ -1102,10 +1109,16 @@ print_day_event (GtkPrintContext *context, PangoFontDescription *font, e_time_format_time (&date_tm, pdi->use_24_hour_format, FALSE, end_buffer, sizeof (end_buffer)); + if (free_text) + t = text; + text = g_strdup_printf ("%s - %s %s ", start_buffer, end_buffer, text); free_text = TRUE; + + if (t) + g_free (t); } bound_text (context, font, text, x1 + 2, y1, x2 - 2, y2); -- cgit