aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/print.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-05-02 00:56:05 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-05-02 00:56:05 +0800
commita37157808d52f4e2cf12db792f0ad3105c02d507 (patch)
tree6e14750214376c0e363edba9c36174ed83f79be9 /calendar/gui/print.c
parent51cade71057025c9de4c663be07c27b358d988e3 (diff)
downloadgsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar.gz
gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.tar.zst
gsoc2013-evolution-a37157808d52f4e2cf12db792f0ad3105c02d507.zip
modify the start and end hours to accomodate all the events in the day
2002-05-01 JP Rosevear <jpr@ximian.com> * gui/print.c (print_day_details): modify the start and end hours to accomodate all the events in the day * gui/e-day-view.c (free_view_popup): only discard the popup if we created one svn path=/trunk/; revision=16655
Diffstat (limited to 'calendar/gui/print.c')
-rw-r--r--calendar/gui/print.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 6e385a065d..b353fc24fb 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -1132,6 +1132,29 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
qsort (pdi.events[0]->data, pdi.events[0]->len,
sizeof (EDayViewEvent), e_day_view_event_sort_func);
+ /* Also print events outside of work hours */
+ if (pdi.events[0]->len > 0) {
+ icaltimezone *zone = get_timezone ();
+ struct icaltimetype tt;
+
+ event = &g_array_index (pdi.events[0], EDayViewEvent, 0);
+ tt = icaltime_from_timet_with_zone (event->start, FALSE, zone);
+ if (tt.hour < pdi.start_hour)
+ pdi.start_hour = tt.hour;
+ pdi.start_minute_offset = pdi.start_hour * 60;
+
+ event = &g_array_index (pdi.events[0], EDayViewEvent, pdi.events[0]->len - 1);
+ tt = icaltime_from_timet_with_zone (event->end, FALSE, zone);
+ if (tt.hour > pdi.end_hour || tt.hour == 0) {
+ pdi.end_hour = tt.hour ? tt.hour : 24;
+ if (tt.minute > 0)
+ pdi.end_hour++;
+ }
+ pdi.end_minute_offset = pdi.end_hour * 60;
+
+ pdi.rows = (pdi.end_hour - pdi.start_hour) * 2;
+ }
+
/* Lay them out the long events, across the top of the page. */
e_day_view_layout_long_events (pdi.long_events, pdi.days_shown,
pdi.day_starts, &rows_in_top_display);