Re: [evolution-patches] [calendar] 313657: IOP: Implement Outlook-like handling of recurrence corner-cases



looks good. Please commit.

thanks, Chenthill.

On Tue, 2005-08-16 at 14:52 -0700, Carsten Guenther wrote:
> Attached patch fixes
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=313657
> 
> Occurrences on non-existing days are now shown on the last day of the 
> month. This makes Evolution more compatible with Outlook/Exchange.
> 
> Please review. Thanks.
> 
> Carsten
> 
> plain text document attachment (313657.diff)
> Index: e-cal-recur.c
> ===================================================================
> RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal-recur.c,v
> retrieving revision 1.6
> diff -u -p -r1.6 e-cal-recur.c
> --- e-cal-recur.c	4 May 2005 06:43:46 -0000	1.6
> +++ e-cal-recur.c	16 Aug 2005 21:47:16 -0000
> @@ -1958,8 +1958,11 @@ cal_obj_remove_duplicates_and_invalid_da
>  				   && (year % 100 != 0
>  				       || year % 400 == 0)))
>  			days++;
> -		if (occ->day > days)
> -			keep_occ = FALSE;
> +
> +		if (occ->day > days) {
> +			/* move occurrence to the last day of the month */
> +			occ->day = days;
> +		}
>  
>  		if (keep_occ) {
>  			if (i != j)
> @@ -2898,10 +2901,15 @@ cal_obj_bymonthday_expand	(RecurData  *r
>  				cotime = month_end_cotime;
>  				cal_obj_time_add_days (&cotime, dayno);
>  			}
> -
> -			/* Skip occurrences if they fall outside the month. */
> -			if (cotime.month == occ->month)
> +			if (cotime.month == occ->month) {
>  				g_array_append_val (new_occs, cotime);
> +			} else {
> +				/* set to last day in month */
> +				cotime.month = occ->month;
> +				cotime.day = time_days_in_month (occ->year, occ->month);
> +				g_array_append_val (new_occs, cotime);
> +			}
> +				
>  			elem = elem->next;
>  		}
>  	}
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]