From 82e05d3fb1bc1e715ef17290375419239c88cb31 Mon Sep 17 00:00:00 2001 From: Kidd Wang Date: Tue, 27 Apr 2004 08:57:13 +0000 Subject: compare the start time and the due time only when both are not null. * gui/e-cal-model-tasks.c: (ecmt_set_value_at): compare the start time and the due time only when both are not null. svn path=/trunk/; revision=25627 --- calendar/ChangeLog | 5 +++++ calendar/gui/e-cal-model-tasks.c | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index df30826223..7bb546ce3d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2004-04-27 Kidd Wang + + * gui/e-cal-model-tasks.c: (ecmt_set_value_at): compare the start + time and the due time only when both are not null. + 2004-04-26 Jeffrey Stedfast * gui/migration.c (migrate_pilot_data): New function to migrate diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 9efa6d4b57..d217957413 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -733,10 +733,15 @@ ecmt_set_value_at (ETableModel *etm, int col, int row, const void *value) if (col < E_CAL_MODEL_FIELD_LAST) { if (col == E_CAL_MODEL_FIELD_DTSTART) { dv = (ECellDateEditValue *) value; - start_tt = dv->tt; + if (dv) + start_tt = dv->tt; + else + start_tt = icaltime_null_time(); due_tt = icalcomponent_get_due (comp_data->icalcomp); - if (icaltime_compare (start_tt, due_tt) > 0) { + if (!icaltime_is_null_time(start_tt) && + !icaltime_is_null_time(due_tt) && + icaltime_compare (start_tt, due_tt) > 0) { dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, @@ -762,9 +767,14 @@ ecmt_set_value_at (ETableModel *etm, int col, int row, const void *value) case E_CAL_MODEL_TASKS_FIELD_DUE : dv = (ECellDateEditValue *) value; start_tt = icalcomponent_get_dtstart (comp_data->icalcomp); - due_tt = dv->tt; + if (dv) + due_tt = dv->tt; + else + due_tt = icaltime_null_time(); - if (icaltime_compare (start_tt, due_tt) > 0) { + if (!icaltime_is_null_time(start_tt) && + !icaltime_is_null_time(due_tt) && + icaltime_compare (start_tt, due_tt) > 0) { dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, -- cgit