From: hs321.lee Date: Mon, 16 Sep 2013 13:07:11 +0000 (+0900) Subject: Fix for N_SE-52109 X-Git-Tag: submit/tizen_2.2/20131107.062123~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=ebea48162d0678c9d07acd6ddd1ea7e78a6b9976;p=framework%2Fosp%2Fsocial.git Fix for N_SE-52109 Change-Id: I8a5ab29ffb66135a417d6c5ad97185af9ec07ce9 Signed-off-by: hs321.lee --- diff --git a/src/FScl_CalEventImpl.cpp b/src/FScl_CalEventImpl.cpp index cbb2c4b..6bd181b 100644 --- a/src/FScl_CalEventImpl.cpp +++ b/src/FScl_CalEventImpl.cpp @@ -967,11 +967,21 @@ _CalEventImpl::ConvertEventHandleToRecurrenceN(calendar_record_h eventHandle) co } else { - r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek); - SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay); + if(pByDay != null) + { + r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay); + + pRecurrence->SetWeekOfMonth(weekOfMonth); + pRecurrence->SetDayOfWeek(dayOfWeek); + } + else + { + DateTime startTime = GetStartTime(); - pRecurrence->SetWeekOfMonth(weekOfMonth); - pRecurrence->SetDayOfWeek(dayOfWeek); + dayOfMonth = startTime.GetDay(); + pRecurrence->SetDayOfMonth(dayOfMonth); + } } break; @@ -993,11 +1003,23 @@ _CalEventImpl::ConvertEventHandleToRecurrenceN(calendar_record_h eventHandle) co } else { - r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek); - SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay); + if(pByDay != null) + { + r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek); + SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[%s] Invalid argument is used. byday = %s", GetErrorMessage(E_INVALID_ARG), pByDay); - pRecurrence->SetWeekOfMonth(weekOfMonth); - pRecurrence->SetDayOfWeek(dayOfWeek); + pRecurrence->SetWeekOfMonth(weekOfMonth); + pRecurrence->SetDayOfWeek(dayOfWeek); + } + else + { + DateTime startTime = GetStartTime(); + + dayOfMonth = startTime.GetDay(); + monthOfYear = startTime.GetMonth(); + + pRecurrence->SetDayOfMonth(dayOfMonth); + } } pRecurrence->SetMonthOfYear(monthOfYear);