aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorSuman Manjunath <msuman@src.gnome.org>2008-01-28 12:46:58 +0800
committerSuman Manjunath <msuman@src.gnome.org>2008-01-28 12:46:58 +0800
commit072795e5a3081544314466d51870c670a08c6198 (patch)
tree984798decbb010b0938ba172fc9692c72b3d25af /calendar/gui
parentdf100f4a47cfc46a01647e80622b95fa6dc76160 (diff)
downloadgsoc2013-evolution-072795e5a3081544314466d51870c670a08c6198.tar.gz
gsoc2013-evolution-072795e5a3081544314466d51870c670a08c6198.tar.zst
gsoc2013-evolution-072795e5a3081544314466d51870c670a08c6198.zip
Patch from Milan Crha <mcrha@redhat.com> ** Fix for bug #355864 (Calendar critical warning when unchecking a webcal)
svn path=/trunk/; revision=34907
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-week-view.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index cca54b0d22..e6dd84ad66 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1926,19 +1926,33 @@ e_week_view_remove_event_cb (EWeekView *week_view,
e_cal_model_free_component_data (event->comp_data);
event->comp_data = NULL;
- /* We leave the span elements in the array, but set the canvas item
- pointers to NULL. */
- for (span_num = 0; span_num < event->num_spans; span_num++) {
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- event->spans_index + span_num);
+ if (week_view->spans) {
+ /* We leave the span elements in the array, but set the canvas item
+ pointers to NULL. */
+ for (span_num = 0; span_num < event->num_spans; span_num++) {
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
- if (span->text_item) {
- gtk_object_destroy (GTK_OBJECT (span->text_item));
- span->text_item = NULL;
+ if (span->text_item) {
+ gtk_object_destroy (GTK_OBJECT (span->text_item));
+ span->text_item = NULL;
+ }
+ if (span->background_item) {
+ gtk_object_destroy (GTK_OBJECT (span->background_item));
+ span->background_item = NULL;
+ }
}
- if (span->background_item) {
- gtk_object_destroy (GTK_OBJECT (span->background_item));
- span->background_item = NULL;
+
+ /* Update event_num numbers for already created spans with event_num higher than our event_num */
+ for (span_num = 0; span_num < week_view->spans->len; span_num++) {
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan, span_num);
+
+ if (span && span->background_item && E_IS_WEEK_VIEW_EVENT_ITEM (span->background_item)) {
+ EWeekViewEventItem *wveitem = E_WEEK_VIEW_EVENT_ITEM (span->background_item);
+
+ if (wveitem->event_num > event_num)
+ wveitem->event_num--;
+ }
}
}