From a11e7afc54918cc11c8dc476f52d8380351808bc Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Sun, 8 Jul 2007 20:27:28 +0000 Subject: Fixes #300584 svn path=/trunk/; revision=33772 --- calendar/gui/e-week-view.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'calendar/gui/e-week-view.c') diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index c52882a5e7..df3950c49b 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -2722,15 +2722,16 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Create the text item if necessary. */ if (!span->text_item) { - ECalComponentText cal_text; + const gchar *summary; GtkWidget *widget; GdkColor color; + gboolean free_text = FALSE; widget = (GtkWidget *)week_view; color = e_week_view_get_text_color (week_view, event, widget); - - e_cal_component_get_summary (comp, &cal_text); + summary = e_calendar_view_get_icalcomponent_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); + span->text_item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), e_text_get_type (), @@ -2738,12 +2739,15 @@ e_week_view_reshape_event_span (EWeekView *week_view, "clip", TRUE, "max_lines", 1, "editable", TRUE, - "text", cal_text.value ? cal_text.value : "", + "text", summary ? summary : "", "use_ellipsis", TRUE, "fill_color_gdk", &color, "im_context", E_CANVAS (week_view->main_canvas)->im_context, NULL); + if (free_text) + g_free ((gchar*)summary); + /* Uncomment once the pango fix is in if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) { @@ -2993,6 +2997,7 @@ cancel_editing (EWeekView *week_view) EWeekViewEvent *event; EWeekViewEventSpan *span; const gchar *summary; + gboolean free_text = FALSE; event_num = week_view->editing_event_num; span_num = week_view->editing_span_num; @@ -3004,9 +3009,12 @@ cancel_editing (EWeekView *week_view) /* Reset the text to what was in the component */ - summary = icalcomponent_get_summary (event->comp_data->icalcomp); + summary = e_calendar_view_get_icalcomponent_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); g_object_set (G_OBJECT (span->text_item), "text", summary ? summary : "", NULL); + if (free_text) + g_free ((gchar*)summary); + /* Stop editing */ e_week_view_stop_editing_event (week_view); } -- cgit