{
errorCode = calendar_db_delete_record(_calendar_event._uri, eventInstance.GetOriginalEventId());
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
-
- errorCode = calendar_db_get_record(_calendar_event._uri, baseEventId, &eventHandle);
- SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "A system error has been occurred.");
- eventRecord.ResetHandle(eventHandle);
}
+ else
+ {
+ // Append exdate
+ errorCode = calendar_record_get_str_p(eventHandle, _calendar_event.exdate, &pExdate);
- // Append exdate
- errorCode = calendar_record_get_str_p(eventHandle, _calendar_event.exdate, &pExdate);
+ String exdate;
+ if (pExdate != null && strlen(pExdate) > 0)
+ {
+ exdate.Append(pExdate);
+ r = exdate.Append(_RECURRENCE_DELIMITER);
+ }
- String exdate;
- if (pExdate != null && strlen(pExdate) > 0)
- {
- exdate.Append(pExdate);
- r = exdate.Append(_RECURRENCE_DELIMITER);
- }
+ r = exdate.Append(_CalendarbookUtil::ConvertDateTimeToRRuleDateTimeString(eventInstance.GetStartTime(), eventInstance.IsAllDayEvent()));
- r = exdate.Append(_CalendarbookUtil::ConvertDateTimeToRRuleDateTimeString(eventInstance.GetStartTime(), eventInstance.IsAllDayEvent()));
+ std::unique_ptr<char[]> pAppendedExdate(_StringConverter::CopyToCharArrayN(exdate));
+ SysTryReturnResult(NID_SCL, pAppendedExdate != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- std::unique_ptr<char[]> pAppendedExdate(_StringConverter::CopyToCharArrayN(exdate));
- SysTryReturnResult(NID_SCL, pAppendedExdate != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- errorCode = calendar_record_set_str(eventHandle, _calendar_event.exdate, pAppendedExdate.get());
+ errorCode = calendar_record_set_str(eventHandle, _calendar_event.exdate, pAppendedExdate.get());
- // Update event handle
- errorCode = calendar_db_update_record(eventHandle);
- SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "A system error has been occurred.");
+ // Update event handle
+ errorCode = calendar_db_update_record(eventHandle);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "A system error has been occurred.");
+ }
return E_SUCCESS;
}