__eventRecord.ResetHandle(eventHandle);
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.start_time, startCalendarTime);
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.end_time, endCalendarTime);
+ calendar_record_set_caltime(eventHandle, _calendar_event.start_time, startCalendarTime);
+ calendar_record_set_caltime(eventHandle, _calendar_event.end_time, endCalendarTime);
// default value
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.event_status, CALENDAR_EVENT_STATUS_NONE);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.busy_status, CALENDAR_EVENT_BUSY_STATUS_FREE);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.priority, CALENDAR_EVENT_PRIORITY_NORMAL);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.sensitivity, CALENDAR_SENSITIVITY_PUBLIC);
+ calendar_record_set_int(eventHandle, _calendar_event.event_status, CALENDAR_EVENT_STATUS_NONE);
+ calendar_record_set_int(eventHandle, _calendar_event.busy_status, CALENDAR_EVENT_BUSY_STATUS_FREE);
+ calendar_record_set_int(eventHandle, _calendar_event.priority, CALENDAR_EVENT_PRIORITY_NORMAL);
+ calendar_record_set_int(eventHandle, _calendar_event.sensitivity, CALENDAR_SENSITIVITY_PUBLIC);
r = __reminderList.Construct();
SysTryReturnVoidResult(NID_SCL, r == E_SUCCESS, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalEventImpl::~_CalEventImpl(void)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_destroy(__eventRecord.ReleaseHandle(), true);
+ calendar_record_destroy(__eventRecord.ReleaseHandle(), true);
__reminderList.RemoveAll(true);
bool
_CalEventImpl::IsRecurring(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int recurrenceFreq = CALENDAR_RECURRENCE_NONE;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.freq, &recurrenceFreq);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.freq, &recurrenceFreq);
if (recurrenceFreq == CALENDAR_RECURRENCE_NONE)
{
bool
_CalEventImpl::IsAllDayEvent(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s startCalendarTime;
- errorCode = calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
+ calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
if (startCalendarTime.type == CALENDAR_TIME_UTIME)
{
return false;
bool isChanged = false;
- errorCode = calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
- errorCode = calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, &endCalendarTime);
+ calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
+ calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, &endCalendarTime);
if (isAllDayEvent && startCalendarTime.type == CALENDAR_TIME_UTIME)
{
tmpEndCalendarTime.time.date.month = tmpEndTime.GetMonth();
tmpEndCalendarTime.time.date.mday = tmpEndTime.GetDay();
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, tmpStartCalendarTime);
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, tmpEndCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, tmpStartCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, tmpEndCalendarTime);
isChanged = true;
}
tmpEndTime.SetValue(endCalendarTime.time.date.year, endCalendarTime.time.date.month, endCalendarTime.time.date.mday);
tmpEndCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(tmpEndTime);
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, tmpStartCalendarTime);
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, tmpEndCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, tmpStartCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, tmpEndCalendarTime);
isChanged = true;
}
if (IsRecurring())
{
int rangeType = CALENDAR_RANGE_NONE;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.range_type, &rangeType);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.range_type, &rangeType);
if (rangeType == CALENDAR_RANGE_UNTIL)
{
calendar_time_s untilCalendarTime;
calendar_time_s tmpUntilCalendarTime;
- errorCode = calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.until_time, &untilCalendarTime);
+ calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.until_time, &untilCalendarTime);
if (isAllDayEvent && untilCalendarTime.type == CALENDAR_TIME_UTIME)
{
tmpUntilCalendarTime.type = CALENDAR_TIME_LOCALTIME;
tmpUntilCalendarTime.time.date.month = tmpUntilTime.GetMonth();
tmpUntilCalendarTime.time.date.mday = tmpUntilTime.GetDay();
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.until_time, tmpUntilCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.until_time, tmpUntilCalendarTime);
}
else if (!isAllDayEvent && untilCalendarTime.type == CALENDAR_TIME_LOCALTIME)
{
tmpUntilTime.SetValue(untilCalendarTime.time.date.year, untilCalendarTime.time.date.month, untilCalendarTime.time.date.mday);
tmpUntilCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(tmpUntilTime);
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.until_time, tmpUntilCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.until_time, tmpUntilCalendarTime);
}
}
std::unique_ptr<char[]> pExDates(_StringConverter::CopyToCharArrayN(ConvertRecurrenceToRRuleExDateString(*__pRecurrence.get(), isAllDayEvent)));
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.exdate, pExDates.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
}
}
{
ClearLastResult();
- int errorCode = CALENDAR_ERROR_NONE;
char* pStrUid = null;
- errorCode = calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.uid, &pStrUid);
+ calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.uid, &pStrUid);
if (pStrUid == null || strlen(pStrUid) == 0)
{
SysTryReturn(NID_SCL, pConvertedUidArray != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.uid, pConvertedUidArray.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
}
else
{
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.uid, null);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
}
return E_SUCCESS;
Tizen::Base::String
_CalEventImpl::GetUid(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pStrUid = null;
- errorCode = calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.uid, &pStrUid);
+ calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.uid, &pStrUid);
return String(pStrUid);
}
SysTryReturnVoidResult(NID_SCL, pStrUid != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.uid, pStrUid.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
EventStatus
_CalEventImpl::GetStatus(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcEventStatus = CALENDAR_EVENT_STATUS_NONE;
EventStatus eventStatus = EVENT_STATUS_NONE;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.event_status, &srcEventStatus);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.event_status, &srcEventStatus);
switch (srcEventStatus)
{
void
_CalEventImpl::SetStatus(EventStatus status)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.event_status, _CalendarbookUtil::ConvertEventStatusToCSEventStatus(status));
+ calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.event_status, _CalendarbookUtil::ConvertEventStatusToCSEventStatus(status));
}
BusyStatus
_CalEventImpl::GetBusyStatus(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcEventBusyStatus = CALENDAR_EVENT_BUSY_STATUS_FREE;
BusyStatus busyStatus = BUSY_STATUS_FREE;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.busy_status, &srcEventBusyStatus);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.busy_status, &srcEventBusyStatus);
switch (srcEventBusyStatus)
{
void
_CalEventImpl::SetBusyStatus(BusyStatus busyStatus)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.busy_status, _CalendarbookUtil::ConvertBusyStatusToCSEventBusyStatus(busyStatus));
+ calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.busy_status, _CalendarbookUtil::ConvertBusyStatusToCSEventBusyStatus(busyStatus));
}
EventPriority
_CalEventImpl::GetPriority(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcPriority = CALENDAR_EVENT_PRIORITY_LOW;
EventPriority priority = EVENT_PRIORITY_NORMAL;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.priority, &srcPriority);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.priority, &srcPriority);
switch (srcPriority)
{
void
_CalEventImpl::SetPriority(EventPriority priority)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.priority, _CalendarbookUtil::ConvertEventPriorityToCSEventPriority(priority));
+ calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.priority, _CalendarbookUtil::ConvertEventPriorityToCSEventPriority(priority));
}
result
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(attendeeHandle, _calendar_attendee.name, pConvertedName.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(attendeeHandle, _calendar_attendee.email, pConvertedEmail.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(attendeeHandle, _calendar_attendee.number, pConvertedPhoneNumber.get());
- errorCode = calendar_record_set_int(attendeeHandle, _calendar_attendee.status, convertedStatus);
- errorCode = calendar_record_set_int(attendeeHandle, _calendar_attendee.role, convertedRole);
- errorCode = calendar_record_set_int(attendeeHandle, _calendar_attendee.person_id, attendee.GetPersonId());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ calendar_record_set_int(attendeeHandle, _calendar_attendee.status, convertedStatus);
+ calendar_record_set_int(attendeeHandle, _calendar_attendee.role, convertedRole);
+ calendar_record_set_int(attendeeHandle, _calendar_attendee.person_id, attendee.GetPersonId());
errorCode = calendar_record_add_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, attendeeHandle);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
result
_CalEventImpl::RemoveAttendee(const Attendee& attendee)
{
- int errorCode = CALENDAR_ERROR_NONE;
int index = _INVALID_ATTENDEE_INDEX;
std::unique_ptr<char[]> pConvertedEmail(_StringConverter::CopyToCharArrayN(attendee.GetEmail()));
SysTryReturnResult(NID_SCL, index != _INVALID_ATTENDEE_INDEX, E_OBJ_NOT_FOUND, "The specified attendee does not exist.")
calendar_record_h tmpAttendeeHandle = null;
- errorCode = calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, index, &tmpAttendeeHandle);
- errorCode = calendar_record_remove_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, tmpAttendeeHandle);
+ calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, index, &tmpAttendeeHandle);
+ calendar_record_remove_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, tmpAttendeeHandle);
return E_SUCCESS;
}
{
ClearLastResult();
- int errorCode = CALENDAR_ERROR_NONE;
-
std::unique_ptr<ArrayList, AllElementsDeleter> pList(new (std::nothrow) ArrayList());
SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
result r = pList->Construct();
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
unsigned int attendeeCount = 0;
- errorCode = calendar_record_get_child_record_count(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, &attendeeCount);
+ calendar_record_get_child_record_count(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, &attendeeCount);
for (int i = 0; i < attendeeCount; i++)
{
AttendeeStatus attendeeStatus = ATTENDEE_STATUS_NONE;
AttendeeRole attendeeRole = ATTENDEE_ROLE_ATTENDEE;
- errorCode = calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, i, &tmpAttendeeHandle);
- errorCode = calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.email, &pTmpEmail);
- errorCode = calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.name, &pTmpName);
- errorCode = calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.number, &pTmpPhoneNumber);
- errorCode = calendar_record_get_int(tmpAttendeeHandle, _calendar_attendee.status, &tmpStatus);
- errorCode = calendar_record_get_int(tmpAttendeeHandle, _calendar_attendee.role, &tmpRole);
- errorCode = calendar_record_get_int(tmpAttendeeHandle, _calendar_attendee.person_id, &tmpPersonId);
+ calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, i, &tmpAttendeeHandle);
+ calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.email, &pTmpEmail);
+ calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.name, &pTmpName);
+ calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.number, &pTmpPhoneNumber);
+ calendar_record_get_int(tmpAttendeeHandle, _calendar_attendee.status, &tmpStatus);
+ calendar_record_get_int(tmpAttendeeHandle, _calendar_attendee.role, &tmpRole);
+ calendar_record_get_int(tmpAttendeeHandle, _calendar_attendee.person_id, &tmpPersonId);
switch (tmpStatus)
{
Tizen::Locales::TimeZone
_CalEventImpl::GetTimeZone(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pTimeZoneId = null;
TimeZone timeZone;
- result r = E_SUCCESS;
- errorCode = calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.start_tzid, &pTimeZoneId);
+ calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.start_tzid, &pTimeZoneId);
if (pTimeZoneId != null && strlen(pTimeZoneId) > 0)
{
- r = TimeZone::GetTimeZone(pTimeZoneId, timeZone);
+ TimeZone::GetTimeZone(pTimeZoneId, timeZone);
}
return timeZone;
SysTryReturnResult(NID_SCL, pConvertedTimeZoneId != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.start_tzid, pConvertedTimeZoneId.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.end_tzid, pConvertedTimeZoneId.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
String
_CalEventImpl::GetSubject(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pSubject = null;
- errorCode = calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.summary, &pSubject);
+ calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.summary, &pSubject);
return String(pSubject);
}
String
_CalEventImpl::GetDescription(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pDescription = null;
- errorCode = calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.description, &pDescription);
+ calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.description, &pDescription);
return String(pDescription);
}
DateTime
_CalEventImpl::GetStartTime(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s startCalendarTime;
DateTime tmpStartTime;
- errorCode = calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
+ calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
if (startCalendarTime.type == CALENDAR_TIME_UTIME)
{
DateTime
_CalEventImpl::GetEndTime(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s endCalendarTime;
DateTime tmpEndTime;
- errorCode = calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, &endCalendarTime);
+ calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, &endCalendarTime);
if (endCalendarTime.type == CALENDAR_TIME_UTIME)
{
String
_CalEventImpl::GetLocation(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pLocation = null;
- errorCode = calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.location, &pLocation);
+ calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.location, &pLocation);
return String(pLocation);
}
EventCategory
_CalEventImpl::GetCategory(void) const
{
-
- int errorCode = CALENDAR_ERROR_NONE;
char* pCategories = null;
- errorCode = calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.categories, &pCategories);
+ calendar_record_get_str_p(__eventRecord.GetHandle(), _calendar_event.categories, &pCategories);
return _CalendarbookUtil::ConvertCSCategoriesToEventCategory(pCategories);
}
RecordSensitivity
_CalEventImpl::GetSensitivity(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
RecordSensitivity sensitivity = SENSITIVITY_PUBLIC;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.sensitivity, &srcSensitivity);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.sensitivity, &srcSensitivity);
switch (srcSensitivity)
{
Recurrence*
_CalEventImpl::ConvertEventHandleToRecurrenceN(calendar_record_h eventHandle) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcFrequency = CALENDAR_RECURRENCE_NONE;
calendar_time_s untilCalendarTime;
int rangeType = CALENDAR_RANGE_NONE;
std::unique_ptr<Recurrence> pRecurrence(new (std::nothrow) Recurrence());
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.freq, &srcFrequency);
+ calendar_record_get_int(eventHandle, _calendar_event.freq, &srcFrequency);
if (srcFrequency == CALENDAR_RECURRENCE_NONE)
{
return null;
}
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.range_type, &rangeType);
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.count, &count);
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.interval, &interval);
- errorCode = calendar_record_get_caltime(eventHandle, _calendar_event.until_time, &untilCalendarTime);
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.wkst, &weekStart);
+ calendar_record_get_int(eventHandle, _calendar_event.range_type, &rangeType);
+ calendar_record_get_int(eventHandle, _calendar_event.count, &count);
+ calendar_record_get_int(eventHandle, _calendar_event.interval, &interval);
+ calendar_record_get_caltime(eventHandle, _calendar_event.until_time, &untilCalendarTime);
+ calendar_record_get_int(eventHandle, _calendar_event.wkst, &weekStart);
- errorCode = calendar_record_get_str_p(eventHandle, _calendar_event.byday, &pByDay);
- errorCode = calendar_record_get_str_p(eventHandle, _calendar_event.bymonthday, &pByMonthDay);
+ calendar_record_get_str_p(eventHandle, _calendar_event.byday, &pByDay);
+ calendar_record_get_str_p(eventHandle, _calendar_event.bymonthday, &pByMonthDay);
if (pByMonthDay != null)
{
r = Integer::Parse(pByMonthDay, dayOfMonth);
SysTryReturn(NID_SCL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
}
- errorCode = calendar_record_get_str_p(eventHandle, _calendar_event.bymonth, &pByMonth);
+ calendar_record_get_str_p(eventHandle, _calendar_event.bymonth, &pByMonth);
if (pByMonth != null)
{
r = Integer::Parse(pByMonth, monthOfYear);
dayOfWeek = ConvertRRuleByDayStringToDayOfWeek(pByDay);
SysTryReturn(NID_SCL, GetLastResult() == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %s", pByDay);
- r = pRecurrence->SetDayOfWeek(dayOfWeek);
+ pRecurrence->SetDayOfWeek(dayOfWeek);
break;
case CALENDAR_RECURRENCE_MONTHLY:
if (dayOfMonth < 0)
{
int maxDaysOfMonth = _CalendarbookUtil::GetMaxDaysOfMonth(untilCalendarTime.time.date.year, monthOfYear);
- r = pRecurrence->SetDayOfMonth(maxDaysOfMonth + dayOfMonth);
+ pRecurrence->SetDayOfMonth(maxDaysOfMonth + dayOfMonth);
}
else
{
- r = pRecurrence->SetDayOfMonth(dayOfMonth);
+ pRecurrence->SetDayOfMonth(dayOfMonth);
}
}
else
{
- r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
+ ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %s", pByDay);
- r = pRecurrence->SetWeekOfMonth(weekOfMonth);
- r = pRecurrence->SetDayOfWeek(dayOfWeek);
+ pRecurrence->SetWeekOfMonth(weekOfMonth);
+ pRecurrence->SetDayOfWeek(dayOfWeek);
}
break;
if (dayOfMonth < 0)
{
int maxDaysOfMonth = _CalendarbookUtil::GetMaxDaysOfMonth(untilCalendarTime.time.date.year, monthOfYear);
- r = pRecurrence->SetDayOfMonth(maxDaysOfMonth + dayOfMonth);
+ pRecurrence->SetDayOfMonth(maxDaysOfMonth + dayOfMonth);
}
else
{
- r = pRecurrence->SetDayOfMonth(dayOfMonth);
+ pRecurrence->SetDayOfMonth(dayOfMonth);
}
}
else
r = ConvertRRuleByDayStringToDayOfWeekAndWeekOfMonth(pByDay, weekOfMonth, dayOfWeek);
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. byday = %s", pByDay);
- r = pRecurrence->SetWeekOfMonth(weekOfMonth);
- r = pRecurrence->SetDayOfWeek(dayOfWeek);
+ pRecurrence->SetWeekOfMonth(weekOfMonth);
+ pRecurrence->SetDayOfWeek(dayOfWeek);
}
- r = pRecurrence->SetMonthOfYear(monthOfYear);
+ pRecurrence->SetMonthOfYear(monthOfYear);
break;
default :
if (rangeType == CALENDAR_RANGE_NONE)
{
- r = pRecurrence->SetUntil(&DateTime::GetMaxValue());
+ pRecurrence->SetUntil(&DateTime::GetMaxValue());
}
else if (rangeType == CALENDAR_RANGE_UNTIL)
{
until = _CalendarbookUtil::ConvertEpochTimeToDateTime(untilCalendarTime.time.utime);
}
- r = pRecurrence->SetUntil(&until);
+ pRecurrence->SetUntil(&until);
}
else
{
- r = pRecurrence->SetCounts(count);
+ pRecurrence->SetCounts(count);
}
- r = pRecurrence->SetInterval(interval);
+ pRecurrence->SetInterval(interval);
switch (weekStart)
{
SysLogException(NID_SCL, E_INVALID_ARG, "Invalid argument is passed. week start = %d", weekStart);
return null;
}
- r = pRecurrence->SetWeekStart(convertedWeekStart);
+ pRecurrence->SetWeekStart(convertedWeekStart);
- errorCode = calendar_record_get_str_p(eventHandle, _calendar_event.exdate, &pExDates);
+ calendar_record_get_str_p(eventHandle, _calendar_event.exdate, &pExDates);
if (pExDates != null && strlen(pExDates) != 0)
{
r = ConvertRRuleExDateStringToRecurrence(pExDates, *pRecurrence.get());
DateTime
_CalEventImpl::GetLastRevisedTime(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
long long lastModifiedTime = 0;
DateTime tmpLastRevisedTime;
- errorCode = calendar_record_get_lli(__eventRecord.GetHandle(), _calendar_event.last_modified_time, &lastModifiedTime);
+ calendar_record_get_lli(__eventRecord.GetHandle(), _calendar_event.last_modified_time, &lastModifiedTime);
tmpLastRevisedTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(lastModifiedTime);
int errorCode = CALENDAR_ERROR_NONE;
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.summary, pConvertedSubject.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
int errorCode = CALENDAR_ERROR_NONE;
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.description, pConvertedDescription.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
int errorCode = CALENDAR_ERROR_NONE;
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.location, pConvertedLocation.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
result
_CalEventImpl::SetStartAndEndTime(const DateTime& start, const DateTime& end)
{
- int errorCode = CALENDAR_ERROR_NONE;
int recurrenceFrequency = 0;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.freq, &recurrenceFrequency);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.freq, &recurrenceFrequency);
SysTryReturnResult(NID_SCL, recurrenceFrequency == CALENDAR_RECURRENCE_NONE, E_INVALID_CONDITION
, "The recurrence date is already set. Cannot modify the start and end date/time.");
result
_CalEventImpl::SetStartAndEndTimeCommon(const DateTime& start, const DateTime& end)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s startCalendarTime;
calendar_time_s endCalendarTime;
- errorCode = calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
+ calendar_record_get_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, &startCalendarTime);
if (startCalendarTime.type == CALENDAR_TIME_LOCALTIME)
{
endCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(end);
}
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, startCalendarTime);
- errorCode = calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, endCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.start_time, startCalendarTime);
+ calendar_record_set_caltime(__eventRecord.GetHandle(), _calendar_event.end_time, endCalendarTime);
return E_SUCCESS;
}
}
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.categories, pConvertedCategory.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
void
_CalEventImpl::SetSensitivity(RecordSensitivity sensitivity)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.sensitivity, _CalendarbookUtil::ConvertSensitivityToCSSensitivity(sensitivity));
+ calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.sensitivity, _CalendarbookUtil::ConvertSensitivityToCSSensitivity(sensitivity));
}
result
SysTryReturnResult(NID_SCL, latitude >= _MIN_LATITUDE && latitude <= _MAX_LATITUDE, E_INVALID_ARG, "Invalid argument is used. The latitude is out of range.");
SysTryReturnResult(NID_SCL, longitude >= _MIN_LONGITUDE && longitude <= _MAX_LONGITUDE, E_INVALID_ARG, "Invalid argument is used. The longitude is out of range.");
- int errorCode = CALENDAR_ERROR_NONE;
-
- errorCode = calendar_record_set_double(__eventRecord.GetHandle(), _calendar_event.latitude, latitude);
- errorCode = calendar_record_set_double(__eventRecord.GetHandle(), _calendar_event.longitude, longitude);
+ calendar_record_set_double(__eventRecord.GetHandle(), _calendar_event.latitude, latitude);
+ calendar_record_set_double(__eventRecord.GetHandle(), _calendar_event.longitude, longitude);
return E_SUCCESS;
}
void
_CalEventImpl::GetCoordinates(double& latitude, double& longitude) const
{
- int errorCode = CALENDAR_ERROR_NONE;
-
- errorCode = calendar_record_get_double(__eventRecord.GetHandle(), _calendar_event.latitude, &latitude);
- errorCode = calendar_record_get_double(__eventRecord.GetHandle(), _calendar_event.longitude, &longitude);
+ calendar_record_get_double(__eventRecord.GetHandle(), _calendar_event.latitude, &latitude);
+ calendar_record_get_double(__eventRecord.GetHandle(), _calendar_event.longitude, &longitude);
}
result
unsigned int reminderCount = 0;
calendar_record_h tmpAlarmHandle = null;
- errorCode = calendar_record_get_child_record_count(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, &reminderCount);
+ calendar_record_get_child_record_count(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, &reminderCount);
if (pReminder != null)
{
if (reminderCount > 0)
{
- errorCode = calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, 0, &tmpAlarmHandle);
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, pReminder->GetTimeOffset());
+ calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, 0, &tmpAlarmHandle);
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, pReminder->GetTimeOffset());
std::unique_ptr<char[]> pTmpAlarmTone(_StringConverter::CopyToCharArrayN(pReminder->GetSoundFile()));
SysTryReturnResult(NID_SCL, pTmpAlarmTone != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(tmpAlarmHandle, _calendar_alarm.tone, pTmpAlarmTone.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
}
else
{
errorCode = calendar_record_create(_calendar_alarm._uri, &tmpAlarmHandle);
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, pReminder->GetTimeOffset());
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, pReminder->GetTimeOffset());
errorCode = calendar_record_set_str(tmpAlarmHandle, _calendar_alarm.tone, pTmpAlarmTone.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_add_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, tmpAlarmHandle);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
}
}
else
{
if (reminderCount > 0)
{
- errorCode = calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, 0, &tmpAlarmHandle);
- errorCode = calendar_record_remove_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, tmpAlarmHandle);
+ calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, 0, &tmpAlarmHandle);
+ calendar_record_remove_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, tmpAlarmHandle);
}
}
std::unique_ptr<char[]> pExDates(_StringConverter::CopyToCharArrayN(ConvertRecurrenceToRRuleExDateString(*pRecurrence, IsAllDayEvent())));
errorCode = calendar_record_set_str(__eventRecord.GetHandle(), _calendar_event.exdate, pExDates.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
__pRecurrence.reset(new (std::nothrow) Recurrence(*pRecurrence));
SysTryReturnResult(NID_SCL, __pRecurrence != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
}
else
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.freq, CALENDAR_RECURRENCE_NONE);
+ calendar_record_set_int(__eventRecord.GetHandle(), _calendar_event.freq, CALENDAR_RECURRENCE_NONE);
__pRecurrence.reset(null);
}
break;
}
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, reminder.GetTimeOffset());
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, reminder.GetTimeOffset());
errorCode = calendar_record_set_str(tmpAlarmHandle, _calendar_alarm.tone, pTmpAlarmTone.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
if (convertedTimeUnit == CALENDAR_ALARM_TIME_UNIT_SPECIFIC)
{
- errorCode = calendar_record_set_lli(tmpAlarmHandle, _calendar_alarm.time, _CalendarbookUtil::ConvertDateTimeToEpochTime(reminder.GetAbsoluteTime()));
+ calendar_record_set_lli(tmpAlarmHandle, _calendar_alarm.time, _CalendarbookUtil::ConvertDateTimeToEpochTime(reminder.GetAbsoluteTime()));
}
errorCode = calendar_record_add_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, tmpAlarmHandle);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
__reminderList.RemoveAll(true);
__reminderListUpdated = false;
errorCode = calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, index, &tmpAlarmHandle);
SysTryReturnResult(NID_SCL, tmpAlarmHandle != null, E_OUT_OF_RANGE, "The index is out of range. index = %d", index);
- errorCode = calendar_record_remove_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, tmpAlarmHandle);
+ calendar_record_remove_child_record(__eventRecord.GetHandle(), _calendar_event.calendar_alarm, tmpAlarmHandle);
__reminderList.RemoveAll(true);
__reminderListUpdated = false;
{
if (*recurrence.GetUntil() == DateTime::GetMaxValue())
{
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.range_type, CALENDAR_RANGE_NONE);
+ calendar_record_set_int(eventHandle, _calendar_event.range_type, CALENDAR_RANGE_NONE);
}
else
{
calendar_time_s startCalendarTime;
calendar_time_s untilCalendarTime;
- errorCode = calendar_record_get_caltime(eventHandle, _calendar_event.start_time, &startCalendarTime);
+ calendar_record_get_caltime(eventHandle, _calendar_event.start_time, &startCalendarTime);
if (startCalendarTime.type == CALENDAR_TIME_LOCALTIME)
{
untilCalendarTime.type = CALENDAR_TIME_LOCALTIME;
untilCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(*recurrence.GetUntil());
}
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.range_type, CALENDAR_RANGE_UNTIL);
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.until_time, untilCalendarTime);
+ calendar_record_set_int(eventHandle, _calendar_event.range_type, CALENDAR_RANGE_UNTIL);
+ calendar_record_set_caltime(eventHandle, _calendar_event.until_time, untilCalendarTime);
}
}
else
{
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.range_type, CALENDAR_RANGE_COUNT);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.count, recurrence.GetCounts());
+ calendar_record_set_int(eventHandle, _calendar_event.range_type, CALENDAR_RANGE_COUNT);
+ calendar_record_set_int(eventHandle, _calendar_event.count, recurrence.GetCounts());
}
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.interval, recurrence.GetInterval());
+ calendar_record_set_int(eventHandle, _calendar_event.interval, recurrence.GetInterval());
switch (recurrence.GetFrequency())
{
case FREQ_DAILY:
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_DAILY);
+ calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_DAILY);
break;
case FREQ_WEEKLY:
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_WEEKLY);
+ calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_WEEKLY);
dayOfWeek = recurrence.GetDayOfWeek();
r = ConvertDayOfWeekToRRuleByDayString(dayOfWeek, 0, dayOfWeekString);
break;
case FREQ_MONTHLY:
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_MONTHLY);
+ calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_MONTHLY);
if (recurrence.GetDayOfMonth() != 0)
{
break;
case FREQ_YEARLY:
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_YEARLY);
+ calendar_record_set_int(eventHandle, _calendar_event.freq, CALENDAR_RECURRENCE_YEARLY);
pByMonth.reset(_StringConverter::CopyToCharArrayN(Integer::ToString(recurrence.GetMonthOfYear())));
}
errorCode = calendar_record_set_str(eventHandle, _calendar_event.byday, pByDay.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(eventHandle, _calendar_event.bymonth, pByMonth.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
errorCode = calendar_record_set_str(eventHandle, _calendar_event.bymonthday, pByMonthDay.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
RecordId
_CalEventImpl::GetCalendarId(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcCalendarbookId = 0;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.calendar_book_id, &srcCalendarbookId);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.calendar_book_id, &srcCalendarbookId);
return srcCalendarbookId;
}
RecordId
_CalEventImpl::GetBaseEventId(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcBaseEventId = INVALID_RECORD_ID;
- errorCode = calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.original_event_id, &srcBaseEventId);
+ calendar_record_get_int(__eventRecord.GetHandle(), _calendar_event.original_event_id, &srcBaseEventId);
return srcBaseEventId;
}
int index = _INVALID_ATTENDEE_INDEX;
unsigned int attendeeCount = 0;
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_get_child_record_count(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, &attendeeCount);
+ calendar_record_get_child_record_count(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, &attendeeCount);
calendar_record_h tmpAttendeeHandle = null;
char* pTmpAttendeeEmail = null;
for (int i = 0; i < attendeeCount; i++)
{
- errorCode = calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, i, &tmpAttendeeHandle);
- errorCode = calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.email, &pTmpAttendeeEmail);
+ calendar_record_get_child_record_at_p(__eventRecord.GetHandle(), _calendar_event.calendar_attendee, i, &tmpAttendeeHandle);
+ calendar_record_get_str_p(tmpAttendeeHandle, _calendar_attendee.email, &pTmpAttendeeEmail);
if (strcmp(pAttendeeEmail, pTmpAttendeeEmail) == 0)
{
String
_CalEventImpl::ConvertRecurrenceToRRuleExDateString(const Recurrence& recurrence, bool isDate) const
{
- result r = E_SUCCESS;
-
bool isNotFirst = false;
String exdateString;
if (isNotFirst)
{
- r = exdateString.Append(_RECURRENCE_DELIMITER);
+ exdateString.Append(_RECURRENCE_DELIMITER);
}
- r = exdateString.Append(_CalendarbookUtil::ConvertDateTimeToRRuleDateTimeString(*pDateTime, isDate));
+ exdateString.Append(_CalendarbookUtil::ConvertDateTimeToRRuleDateTimeString(*pDateTime, isDate));
isNotFirst = true;
}
tmpDateTime = _CalendarbookImpl::GetMinDateTime();
ClearLastResult();
}
- r = tmpDateTime.SetValue(tmpDateTime.GetYear(), tmpDateTime.GetMonth(), tmpDateTime.GetDay(), 0, 0, 0);
+ tmpDateTime.SetValue(tmpDateTime.GetYear(), tmpDateTime.GetMonth(), tmpDateTime.GetDay(), 0, 0, 0);
calendar_time_s convertedCalendarTime;
convertedCalendarTime.type = CALENDAR_TIME_UTIME;
convertedCalendarTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(tmpDateTime);
- errorCode = calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedCalendarTime);
- errorCode = calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedCalendarTime);
+ calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedCalendarTime);
+ calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedCalendarTime);
}
else
{
convertedDueTime.type = CALENDAR_TIME_UTIME;
convertedDueTime.time.utime = _CALENDAR_TODO_NO_DUE_DATE;
- errorCode = calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedStartTime);
- errorCode = calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedDueTime);
+ calendar_record_set_caltime(todoHandle, _calendar_todo.start_time, convertedStartTime);
+ calendar_record_set_caltime(todoHandle, _calendar_todo.due_time, convertedDueTime);
}
// default value
- errorCode = calendar_record_set_int(todoHandle, _calendar_todo.todo_status, CALENDAR_TODO_STATUS_NONE);
- errorCode = calendar_record_set_int(todoHandle, _calendar_todo.priority, CALENDAR_TODO_PRIORITY_NORMAL);
- errorCode = calendar_record_set_int(todoHandle, _calendar_todo.sensitivity, CALENDAR_SENSITIVITY_PUBLIC);
+ calendar_record_set_int(todoHandle, _calendar_todo.todo_status, CALENDAR_TODO_STATUS_NONE);
+ calendar_record_set_int(todoHandle, _calendar_todo.priority, CALENDAR_TODO_PRIORITY_NORMAL);
+ calendar_record_set_int(todoHandle, _calendar_todo.sensitivity, CALENDAR_SENSITIVITY_PUBLIC);
__todoRecord.ResetHandle(todoHandle);
String
_CalTodoImpl::GetSubject(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pSubject = null;
- errorCode = calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.summary, &pSubject);
+ calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.summary, &pSubject);
return String(pSubject);
}
String
_CalTodoImpl::GetDescription(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pDescription = null;
- errorCode = calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.description, &pDescription);
+ calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.description, &pDescription);
return String(pDescription);
}
{
ClearLastResult();
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s tmpCalendarTime;
- errorCode = calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &tmpCalendarTime);
+ calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &tmpCalendarTime);
if (tmpCalendarTime.time.utime == _CALENDAR_TODO_NO_START_DATE)
{
{
ClearLastResult();
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s tmpCalendarTime;
- errorCode = calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &tmpCalendarTime);
+ calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &tmpCalendarTime);
if (tmpCalendarTime.time.utime == _CALENDAR_TODO_NO_DUE_DATE)
{
TodoPriority
_CalTodoImpl::GetPriority(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcPriority = CALENDAR_EVENT_PRIORITY_LOW;
TodoPriority priority = TODO_PRIORITY_NORMAL;
- errorCode = calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.priority, &srcPriority);
+ calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.priority, &srcPriority);
switch (srcPriority)
{
TodoStatus
_CalTodoImpl::GetStatus(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcStatus = CALENDAR_EVENT_STATUS_NONE;
TodoStatus status = TODO_STATUS_NONE;
- errorCode = calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, &srcStatus);
+ calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, &srcStatus);
switch (srcStatus)
{
RecordSensitivity
_CalTodoImpl::GetSensitivity(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
RecordSensitivity sensitivity = SENSITIVITY_PUBLIC;
- errorCode = calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, &srcSensitivity);
+ calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, &srcSensitivity);
switch (srcSensitivity)
{
DateTime
_CalTodoImpl::GetLastRevisedTime(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
long long lastModifiedTime = 0;
DateTime tmpLastRevisedTime;
- errorCode = calendar_record_get_lli(__todoRecord.GetHandle(), _calendar_todo.last_modified_time, &lastModifiedTime);
+ calendar_record_get_lli(__todoRecord.GetHandle(), _calendar_todo.last_modified_time, &lastModifiedTime);
tmpLastRevisedTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(lastModifiedTime);
int errorCode = CALENDAR_ERROR_NONE;
errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.summary, pConvertedSubject.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
int errorCode = CALENDAR_ERROR_NONE;
errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.description, pConvertedDescription.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
SysTryReturnResult(NID_SCL, _CalendarbookUtil::CheckValidDateTime(dueDate), E_INVALID_ARG, "Invalid argument is used. The end date is invalid.");
SysTryReturnResult(NID_SCL, startDate <= dueDate, E_INVALID_ARG, "Invalid argument is used. The end date is earlier than the start date.");
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s convertedStartTime;
calendar_time_s convertedDueTime;
convertedDueTime.type = CALENDAR_TIME_UTIME;
convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(dueDate);
- errorCode = calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
- errorCode = calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
+ calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
+ calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
return E_SUCCESS;
}
result
_CalTodoImpl::SetStartDate(const DateTime& startDate)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s convertedStartTime;
convertedStartTime.type = CALENDAR_TIME_UTIME;
else
{
calendar_time_s convertedDueTime;
- errorCode = calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &convertedDueTime);
+ calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, &convertedDueTime);
convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(startDate);
if (convertedStartTime.time.utime > convertedDueTime.time.utime)
{
convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(DateTime::GetMinValue());
- errorCode = calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
+ calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
}
}
- errorCode = calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
-
+ calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
return E_SUCCESS;
}
result
_CalTodoImpl::SetDueDate(const DateTime& dueDate)
{
- int errorCode = CALENDAR_ERROR_NONE;
calendar_time_s convertedDueTime;
convertedDueTime.type = CALENDAR_TIME_UTIME;
else
{
calendar_time_s convertedStartTime;
- errorCode = calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &convertedStartTime);
+ calendar_record_get_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, &convertedStartTime);
convertedDueTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(dueDate);
if (convertedStartTime.time.utime > convertedDueTime.time.utime)
{
convertedStartTime.time.utime = _CalendarbookUtil::ConvertDateTimeToEpochTime(DateTime::GetMinValue());
- errorCode = calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
+ calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.start_time, convertedStartTime);
}
}
- errorCode = calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
+ calendar_record_set_caltime(__todoRecord.GetHandle(), _calendar_todo.due_time, convertedDueTime);
return E_SUCCESS;
}
void
_CalTodoImpl::SetPriority(TodoPriority priority)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.priority, _CalendarbookUtil::ConvertTodoPriorityToCSTodoPriority(priority));
+ calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.priority, _CalendarbookUtil::ConvertTodoPriorityToCSTodoPriority(priority));
}
void
_CalTodoImpl::SetStatus(TodoStatus status)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, _CalendarbookUtil::ConvertTodoStatusToCSTodoStatus(status));
+ calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.todo_status, _CalendarbookUtil::ConvertTodoStatusToCSTodoStatus(status));
}
void
_CalTodoImpl::SetSensitivity(RecordSensitivity sensitivity)
{
- int errorCode = CALENDAR_ERROR_NONE;
- errorCode = calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, _CalendarbookUtil::ConvertSensitivityToCSSensitivity(sensitivity));
+ calendar_record_set_int(__todoRecord.GetHandle(), _calendar_todo.sensitivity, _CalendarbookUtil::ConvertSensitivityToCSSensitivity(sensitivity));
}
void
int errorCode = CALENDAR_ERROR_NONE;
errorCode = calendar_record_set_str(__todoRecord.GetHandle(), _calendar_todo.location, pConvertedLocation.get());
+ SysTryReturnVoidResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
String
_CalTodoImpl::GetLocation(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
char* pLocation = null;
- errorCode = calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.location, &pLocation);
+ calendar_record_get_str_p(__todoRecord.GetHandle(), _calendar_todo.location, &pLocation);
return String(pLocation);
}
SysTryReturnResult(NID_SCL, latitude >= _MIN_LATITUDE && latitude <= _MAX_LATITUDE, E_INVALID_ARG, "Invalid argument is used. The latitude is out of range.");
SysTryReturnResult(NID_SCL, longitude >= _MIN_LONGITUDE && longitude <= _MAX_LONGITUDE, E_INVALID_ARG, "Invalid argument is used. The longitude is out of range.");
- int errorCode = CALENDAR_ERROR_NONE;
-
- errorCode = calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.latitude, latitude);
- errorCode = calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.longitude, longitude);
+ calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.latitude, latitude);
+ calendar_record_set_double(__todoRecord.GetHandle(), _calendar_todo.longitude, longitude);
return E_SUCCESS;
}
void
_CalTodoImpl::GetCoordinates(double& latitude, double& longitude) const
{
- int errorCode = CALENDAR_ERROR_NONE;
-
- errorCode = calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.latitude, &latitude);
- errorCode = calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.longitude, &longitude);
+ calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.latitude, &latitude);
+ calendar_record_get_double(__todoRecord.GetHandle(), _calendar_todo.longitude, &longitude);
}
result
break;
}
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
- errorCode = calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, reminder.GetTimeOffset());
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick_unit, convertedTimeUnit);
+ calendar_record_set_int(tmpAlarmHandle, _calendar_alarm.tick, reminder.GetTimeOffset());
errorCode = calendar_record_set_str(tmpAlarmHandle, _calendar_alarm.tone, pTmpAlarmTone.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
if (convertedTimeUnit == CALENDAR_ALARM_TIME_UNIT_SPECIFIC)
{
- errorCode = calendar_record_set_lli(tmpAlarmHandle, _calendar_alarm.time, _CalendarbookUtil::ConvertDateTimeToEpochTime(reminder.GetAbsoluteTime()));
+ calendar_record_set_lli(tmpAlarmHandle, _calendar_alarm.time, _CalendarbookUtil::ConvertDateTimeToEpochTime(reminder.GetAbsoluteTime()));
}
errorCode = calendar_record_add_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
__reminderList.RemoveAll(true);
__reminderListUpdated = false;
errorCode = calendar_record_get_child_record_at_p(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, index, &tmpAlarmHandle);
SysTryReturnResult(NID_SCL, tmpAlarmHandle != null, E_OUT_OF_RANGE, "The index is either equal to or greater than the number of reminders or less than 0.");
- errorCode = calendar_record_remove_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
+ calendar_record_remove_child_record(__todoRecord.GetHandle(), _calendar_todo.calendar_alarm, tmpAlarmHandle);
__reminderList.RemoveAll(true);
__reminderListUpdated = false;
RecordId
_CalTodoImpl::GetCalendarId(void) const
{
- int errorCode = CALENDAR_ERROR_NONE;
int srcCalendarbookId = 0;
- errorCode = calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.calendar_book_id, &srcCalendarbookId);
+ calendar_record_get_int(__todoRecord.GetHandle(), _calendar_todo.calendar_book_id, &srcCalendarbookId);
return srcCalendarbookId;
}
calendar_record_h eventHandle = _CalEventImpl::GetInstance(event)->GetRecordHandle();
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.calendar_book_id, _DEFAULT_EVENT_CALENDAR_DB_ID);
+ calendar_record_set_int(eventHandle, _calendar_event.calendar_book_id, _DEFAULT_EVENT_CALENDAR_DB_ID);
errorCode = calendar_db_insert_record(eventHandle, &dbIndex);
SysTryReturnResult(NID_SCL, errorCode != CALENDAR_ERROR_FILE_NO_SPACE, E_STORAGE_FULL, "The storage is insufficient.");
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "A system error has been occurred.");
calendar_record_h eventHandle = _CalEventImpl::GetInstance(event)->GetRecordHandle();
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.calendar_book_id, calendarId);
+ calendar_record_set_int(eventHandle, _calendar_event.calendar_book_id, calendarId);
errorCode = calendar_db_insert_record(eventHandle, &dbIndex);
SysTryReturnResult(NID_SCL, errorCode != CALENDAR_ERROR_FILE_NO_SPACE, E_STORAGE_FULL, "The storage is insufficient.");
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "A system error has been occurred.");
calendar_record_h todoHandle = _CalTodoImpl::GetInstance(todo)->GetRecordHandle();
- errorCode = calendar_record_set_int(todoHandle, _calendar_todo.calendar_book_id, _DEFAULT_TODO_CALENDAR_DB_ID);
+ calendar_record_set_int(todoHandle, _calendar_todo.calendar_book_id, _DEFAULT_TODO_CALENDAR_DB_ID);
errorCode = calendar_db_insert_record(todoHandle, &dbIndex);
SysTryReturnResult(NID_SCL, errorCode != CALENDAR_ERROR_FILE_NO_SPACE, E_STORAGE_FULL, "The storage is insufficient.");
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "A system error has been occurred.");
calendar_record_h todoHandle = _CalTodoImpl::GetInstance(todo)->GetRecordHandle();
- errorCode = calendar_record_set_int(todoHandle, _calendar_todo.calendar_book_id, calendarId);
+ calendar_record_set_int(todoHandle, _calendar_todo.calendar_book_id, calendarId);
errorCode = calendar_db_insert_record(todoHandle, &dbIndex);
SysTryReturnResult(NID_SCL, errorCode != CALENDAR_ERROR_FILE_NO_SPACE, E_STORAGE_FULL, "The storage is insufficient.");
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_SYSTEM, "A system error has been occurred.");
calendar_record_h calendarHandle = _CalendarImpl::GetInstance(calendar)->GetRecordHandle();
- errorCode = calendar_record_set_int(calendarHandle, _calendar_book.account_id, accountId);
+ calendar_record_set_int(calendarHandle, _calendar_book.account_id, accountId);
errorCode = calendar_db_insert_record(calendarHandle, &dbIndex);
SysTryReturnResult(NID_SCL, errorCode != CALENDAR_ERROR_FILE_NO_SPACE, E_STORAGE_FULL, "The storage is insufficient.");
SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OBJ_NOT_FOUND, "The specified record is not found.");
int baseEventId = _INVALID_EVENT_DB_ID;
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.original_event_id, &baseEventId);
+ calendar_record_get_int(eventHandle, _calendar_event.original_event_id, &baseEventId);
calendar_record_destroy(eventHandle, true);
SysTryReturn(NID_SCL, pTodo != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_db_get_record(_calendar_todo._uri, todoId, &todoHandle);
-
SysTryReturn(NID_SCL, errorCode != CALENDAR_ERROR_DB_FAILED, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The specified record is not found.");
// Condition : Due time of the item >= start time of filter
errorCode = calendar_filter_add_caltime(mainFilterHandle, _calendar_todo.due_time, CALENDAR_MATCH_GREATER_THAN_OR_EQUAL, convertedStartTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Due time of the item <= end time of filter
errorCode = calendar_filter_add_operator(mainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(mainFilterHandle, _calendar_todo.due_time, CALENDAR_MATCH_LESS_THAN_OR_EQUAL, convertedEndTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : status
calendar_filter_h subFilterHandle = null;
if (alreadyAdded)
{
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_OR);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
errorCode = calendar_filter_add_int(subFilter.GetHandle(), _calendar_todo.todo_status, CALENDAR_MATCH_EQUAL, ConvertTodoStatusToCalendarTodoStatus(tmpStatus));
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
alreadyAdded = true;
}
}
errorCode = calendar_filter_add_operator(mainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(mainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : priority
errorCode = calendar_filter_create(_calendar_todo._uri, &subFilterHandle);
if (alreadyAdded)
{
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_OR);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
errorCode = calendar_filter_add_int(subFilter.GetHandle(), _calendar_todo.priority, CALENDAR_MATCH_EQUAL, ConvertTodoPriorityToCalendarTodoPriority(tmpPriority));
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
alreadyAdded = true;
}
}
errorCode = calendar_filter_add_operator(mainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(mainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Create query
calendar_query_h queryHandle = null;
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalendarQuery query(queryHandle);
- errorCode = calendar_query_set_sort(queryHandle, _calendar_todo.due_time, true);
- errorCode = calendar_query_set_filter(queryHandle, mainFilterHandle);
+ calendar_query_set_sort(queryHandle, _calendar_todo.due_time, true);
+ calendar_query_set_filter(queryHandle, mainFilterHandle);
calendar_list_h calendarListHandle = null;
errorCode = calendar_db_get_records_with_query(queryHandle, (pageNo - 1) * countPerPage, countPerPage, &calendarListHandle);
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
for (int i = 0; i < count; i++)
{
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
std::unique_ptr<IEnumerator> pEnum(pList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
CalTodo* pTmpTodo = static_cast<CalTodo*>(pEnum->GetCurrent());
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
_CalTodoImpl::GetInstance(*pTmpTodo)->SetRecordHandle(tmpRecordHandle);
int dbIndex = -1;
- errorCode = calendar_record_get_int(tmpRecordHandle, _calendar_todo.id, &dbIndex);
+ calendar_record_get_int(tmpRecordHandle, _calendar_todo.id, &dbIndex);
_RecordImpl::GetInstance(*pTmpTodo)->SetRecordId(dbIndex);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
return pList.release();
}
// Condition : Due time of the item => start time of filter
errorCode = calendar_filter_add_caltime(mainFilterHandle, _calendar_todo.due_time, CALENDAR_MATCH_GREATER_THAN_OR_EQUAL, convertedStartTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Due time of the item <= end time of filter
errorCode = calendar_filter_add_operator(mainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(mainFilterHandle, _calendar_todo.due_time, CALENDAR_MATCH_LESS_THAN_OR_EQUAL, convertedEndTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : status
calendar_filter_h subFilterHandle = null;
if (alreadyAdded)
{
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_OR);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
errorCode = calendar_filter_add_int(subFilter.GetHandle(), _calendar_todo.todo_status, CALENDAR_MATCH_EQUAL, ConvertTodoStatusToCalendarTodoStatus(tmpStatus));
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
alreadyAdded = true;
}
tmpStatus <<= 1;
}
errorCode = calendar_filter_add_operator(mainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(mainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : priority
errorCode = calendar_filter_create(_calendar_todo._uri, &subFilterHandle);
if (alreadyAdded)
{
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_OR);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
errorCode = calendar_filter_add_int(subFilter.GetHandle(), _calendar_todo.priority, CALENDAR_MATCH_EQUAL, ConvertTodoPriorityToCalendarTodoPriority(tmpPriority));
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
alreadyAdded = true;
}
}
errorCode = calendar_filter_add_operator(mainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(mainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Create query
calendar_query_h queryHandle = null;
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, _INVALID_COUNT, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalendarQuery query(queryHandle);
- errorCode = calendar_query_set_filter(queryHandle, mainFilterHandle);
+ calendar_query_set_filter(queryHandle, mainFilterHandle);
int count = _INVALID_COUNT;
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
for (int i = 0; i < count; i++)
{
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
std::unique_ptr<IEnumerator> pEnum(pList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
CalEvent* pTmpEvent = static_cast<CalEvent*>(pEnum->GetCurrent());
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
_CalEventImpl::GetInstance(*pTmpEvent)->SetRecordHandle(tmpRecordHandle);
int dbIndex = -1;
- errorCode = calendar_record_get_int(tmpRecordHandle, _calendar_event.id, &dbIndex);
+ calendar_record_get_int(tmpRecordHandle, _calendar_event.id, &dbIndex);
_RecordImpl::GetInstance(*pTmpEvent)->SetRecordId(dbIndex);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
return pList.release();
}
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
for (int i = 0; i < count; i++)
{
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
std::unique_ptr<IEnumerator> pEnum(pList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
CalTodo* pTmpTodo = static_cast<CalTodo*>(pEnum->GetCurrent());
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
_CalTodoImpl::GetInstance(*pTmpTodo)->SetRecordHandle(tmpRecordHandle);
int dbIndex = -1;
- errorCode = calendar_record_get_int(tmpRecordHandle, _calendar_todo.id, &dbIndex);
+ calendar_record_get_int(tmpRecordHandle, _calendar_todo.id, &dbIndex);
_RecordImpl::GetInstance(*pTmpTodo)->SetRecordId(dbIndex);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
return pList.release();
}
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
for (int i = 0; i < count; i++)
{
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
std::unique_ptr<IEnumerator> pEnum(pList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
Calendar* pTmpCalendar = static_cast<Calendar*>(pEnum->GetCurrent());
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
_CalendarImpl::GetInstance(*pTmpCalendar)->SetRecordHandle(tmpRecordHandle);
int dbIndex = -1;
- errorCode = calendar_record_get_int(tmpRecordHandle, _calendar_book.id, &dbIndex);
+ calendar_record_get_int(tmpRecordHandle, _calendar_book.id, &dbIndex);
_RecordImpl::GetInstance(*pTmpCalendar)->SetRecordId(dbIndex);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
return pList.release();
}
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
std::unique_ptr<CalEventChangeInfo> pChangedInfo(_CalendarbookImpl::ConvertModifiedEventToCalEventChangeInfoN(tmpRecordHandle));
SysTryReturn(NID_SCL, pChangedInfo != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pList->Add(*pChangedInfo.release());
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
latestVersion = tmpLatestVersion;
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
std::unique_ptr<CalTodoChangeInfo> pChangedInfo(_CalendarbookImpl::ConvertModifiedTodoToCalTodoChangeInfoN(tmpRecordHandle));
SysTryReturn(NID_SCL, pChangedInfo != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pList->Add(*pChangedInfo.release());
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
latestVersion = tmpLatestVersion;
result
_CalendarbookImpl::RemoveEventInstance(const CalEventInstance& eventInstance)
{
- result r = E_SUCCESS;
int errorCode = CALENDAR_ERROR_NONE;
calendar_record_h eventHandle = null;
_CalendarRecord eventRecord(eventHandle);
int baseEventId = _INVALID_EVENT_DB_ID;
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.original_event_id, &baseEventId);
+ calendar_record_get_int(eventHandle, _calendar_event.original_event_id, &baseEventId);
if (baseEventId != _INVALID_EVENT_DB_ID)
{
else
{
// Append exdate
- errorCode = calendar_record_get_str_p(eventHandle, _calendar_event.exdate, &pExdate);
+ 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);
+ exdate.Append(_RECURRENCE_DELIMITER);
}
- r = exdate.Append(_CalendarbookUtil::ConvertDateTimeToRRuleDateTimeString(eventInstance.GetStartTime(), eventInstance.IsAllDayEvent()));
+ 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.");
errorCode = calendar_record_set_str(eventHandle, _calendar_event.exdate, pAppendedExdate.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
// Update event handle
errorCode = calendar_db_update_record(eventHandle);
result
_CalendarbookImpl::UpdateEventInstance(const CalEventInstance& eventInstance, CalEvent& event)
{
- result r = E_SUCCESS;
int errorCode = CALENDAR_ERROR_NONE;
SysTryReturnResult(NID_SCL, event.GetRecordId() != INVALID_RECORD_ID, E_INVALID_ARG
_CalendarRecord eventRecord(eventHandle);
int baseEventId = _INVALID_EVENT_DB_ID;
- errorCode = calendar_record_get_int(eventHandle, _calendar_event.original_event_id, &baseEventId);
+ calendar_record_get_int(eventHandle, _calendar_event.original_event_id, &baseEventId);
calendar_record_h baseEventHandle = null;
if (baseEventId == _INVALID_EVENT_DB_ID)
_CalendarRecord baseEventRecord(baseEventHandle);
int tmpIntValue = 0;
- errorCode = calendar_record_get_int(baseEventHandle, _calendar_event.freq, &tmpIntValue);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.freq, tmpIntValue);
- errorCode = calendar_record_get_int(baseEventHandle, _calendar_event.range_type, &tmpIntValue);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.range_type, tmpIntValue);
- errorCode = calendar_record_get_int(baseEventHandle, _calendar_event.count, &tmpIntValue);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.count, tmpIntValue);
- errorCode = calendar_record_get_int(baseEventHandle, _calendar_event.interval, &tmpIntValue);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.interval, tmpIntValue);
- errorCode = calendar_record_get_int(baseEventHandle, _calendar_event.wkst, &tmpIntValue);
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.wkst, tmpIntValue);
+ calendar_record_get_int(baseEventHandle, _calendar_event.freq, &tmpIntValue);
+ calendar_record_set_int(eventHandle, _calendar_event.freq, tmpIntValue);
+ calendar_record_get_int(baseEventHandle, _calendar_event.range_type, &tmpIntValue);
+ calendar_record_set_int(eventHandle, _calendar_event.range_type, tmpIntValue);
+ calendar_record_get_int(baseEventHandle, _calendar_event.count, &tmpIntValue);
+ calendar_record_set_int(eventHandle, _calendar_event.count, tmpIntValue);
+ calendar_record_get_int(baseEventHandle, _calendar_event.interval, &tmpIntValue);
+ calendar_record_set_int(eventHandle, _calendar_event.interval, tmpIntValue);
+ calendar_record_get_int(baseEventHandle, _calendar_event.wkst, &tmpIntValue);
+ calendar_record_set_int(eventHandle, _calendar_event.wkst, tmpIntValue);
calendar_time_s tmpTimeValue;
- errorCode = calendar_record_get_caltime(baseEventHandle, _calendar_event.until_time, &tmpTimeValue);
+ calendar_record_get_caltime(baseEventHandle, _calendar_event.until_time, &tmpTimeValue);
+
bool tmpIsAllDay = 0;
calendar_time_s tmpStartTimeValue;
DateTime convertedTime;
- errorCode = calendar_record_get_caltime(eventHandle, _calendar_event.start_time, &tmpStartTimeValue);
+ calendar_record_get_caltime(eventHandle, _calendar_event.start_time, &tmpStartTimeValue);
if (tmpTimeValue.type != tmpStartTimeValue.type)
{
tmpTimeValue.time.date.mday = convertedTime.GetDay();
}
}
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.until_time, tmpTimeValue);
+ calendar_record_set_caltime(eventHandle, _calendar_event.until_time, tmpTimeValue);
char* tmpStrValue = null;
- errorCode = calendar_record_get_str_p(baseEventHandle, _calendar_event.byday, &tmpStrValue);
+ calendar_record_get_str_p(baseEventHandle, _calendar_event.byday, &tmpStrValue);
errorCode = calendar_record_set_str(eventHandle, _calendar_event.byday, tmpStrValue);
- errorCode = calendar_record_get_str_p(baseEventHandle, _calendar_event.bymonthday, &tmpStrValue);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ calendar_record_get_str_p(baseEventHandle, _calendar_event.bymonthday, &tmpStrValue);
errorCode = calendar_record_set_str(eventHandle, _calendar_event.bymonthday, tmpStrValue);
- errorCode = calendar_record_get_str_p(baseEventHandle, _calendar_event.bymonth, &tmpStrValue);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ calendar_record_get_str_p(baseEventHandle, _calendar_event.bymonth, &tmpStrValue);
errorCode = calendar_record_set_str(eventHandle, _calendar_event.bymonth, tmpStrValue);
- errorCode = calendar_record_get_str_p(baseEventHandle, _calendar_event.exdate, &tmpStrValue);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ calendar_record_get_str_p(baseEventHandle, _calendar_event.exdate, &tmpStrValue);
errorCode = calendar_record_set_str(eventHandle, _calendar_event.exdate, tmpStrValue);
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
if (baseEventId == _INVALID_EVENT_DB_ID)
{
- errorCode = calendar_record_set_int(eventHandle, _calendar_event.original_event_id, eventInstance.GetOriginalEventId());
+ calendar_record_set_int(eventHandle, _calendar_event.original_event_id, eventInstance.GetOriginalEventId());
std::unique_ptr<char[]> pConvertedRecurrenceId(_StringConverter::CopyToCharArrayN(_CalendarbookUtil::ConvertDateTimeToRRuleDateTimeString(eventInstance.GetStartTime(), eventInstance.IsAllDayEvent())));
errorCode = calendar_record_set_str(eventHandle, _calendar_event.recurrence_id, pConvertedRecurrenceId.get());
+ SysTryReturnResult(NID_SCL, errorCode == CALENDAR_ERROR_NONE, E_OUT_OF_MEMORY, "Memory allocation failed.");
int dbIndex = -1;
errorCode = calendar_db_insert_record(eventHandle, &dbIndex);
viewSortPropertyId = _CalendarbookFilterImpl::GetViewPropertyId(type, propertySortedBy);
ascending = (sortOrder == SORT_ORDER_ASCENDING) ? true : false;
- errorCode = calendar_query_set_sort(queryHandle, viewSortPropertyId, ascending);
+ calendar_query_set_sort(queryHandle, viewSortPropertyId, ascending);
}
if (filterHandle)
{
- errorCode = calendar_query_set_filter(queryHandle, filterHandle);
+ calendar_query_set_filter(queryHandle, filterHandle);
}
calendar_list_h resultListHandle = null;
{
pList.reset(ConvertRecordListN<CalEvent, _CalEventImpl, _calendar_event_property_ids>(resultListHandle, _calendar_event));
SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
}
break;
case CB_FI_TYPE_TODO:
{
pList.reset(ConvertRecordListN<CalTodo, _CalTodoImpl, _calendar_todo_property_ids>(resultListHandle, _calendar_todo));
SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
}
break;
case CB_FI_TYPE_CALENDAR:
{
pList.reset(ConvertRecordListN<Calendar, _CalendarImpl, _calendar_book_property_ids>(resultListHandle, _calendar_book));
SysTryReturn(NID_SCL, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
}
break;
case CB_FI_TYPE_ALL_DAY_EVENT_INSTANCE:
if (filterHandle)
{
- errorCode = calendar_query_set_filter(queryHandle, filterHandle);
+ calendar_query_set_filter(queryHandle, filterHandle);
}
int count = _INVALID_COUNT;
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_next(calendarListHandle);
char* pUri = null;
- errorCode = calendar_record_get_uri_p(tmpRecordHandle, &pUri);
+ calendar_record_get_uri_p(tmpRecordHandle, &pUri);
if (strcmp(pUri, _calendar_event._uri) == 0)
{
}
else
{
- errorCode = calendar_list_remove(calendarListHandle, tmpRecordHandle);
- errorCode = calendar_record_destroy(tmpRecordHandle, true);
+ calendar_list_remove(calendarListHandle, tmpRecordHandle);
+ calendar_record_destroy(tmpRecordHandle, true);
}
}
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
std::unique_ptr<IEnumerator> pEnum(pList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
CalEvent* pTmpEvent = static_cast<CalEvent*>(pEnum->GetCurrent());
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
_CalEventImpl::GetInstance(*pTmpEvent)->SetRecordHandle(tmpRecordHandle);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
return pList.release();
}
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_get_count(calendarListHandle, &count);
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_next(calendarListHandle);
char* pUri = null;
- errorCode = calendar_record_get_uri_p(tmpRecordHandle, &pUri);
+ calendar_record_get_uri_p(tmpRecordHandle, &pUri);
if (strcmp(pUri, _calendar_todo._uri) == 0)
{
}
else
{
- errorCode = calendar_list_remove(calendarListHandle, tmpRecordHandle);
- errorCode = calendar_record_destroy(tmpRecordHandle, true);
+ calendar_list_remove(calendarListHandle, tmpRecordHandle);
+ calendar_record_destroy(tmpRecordHandle, true);
}
}
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_first(calendarListHandle);
std::unique_ptr<IEnumerator> pEnum(pList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
CalTodo* pTmpTodo = static_cast<CalTodo*>(pEnum->GetCurrent());
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
_CalTodoImpl::GetInstance(*pTmpTodo)->SetRecordHandle(tmpRecordHandle);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
- errorCode = calendar_list_destroy(calendarList.ReleaseHandle(), false);
+ calendar_list_destroy(calendarList.ReleaseHandle(), false);
return pList.release();
}
// Condition : End time of the item > start time of filter
errorCode = calendar_filter_add_caltime(allDayEventInstanceMainFilterHandle, _calendar_instance_allday_calendar_book.end_time, CALENDAR_MATCH_GREATER_THAN_OR_EQUAL, localStartTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Start time of the item < end time of filter
errorCode = calendar_filter_add_operator(allDayEventInstanceMainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(allDayEventInstanceMainFilterHandle, _calendar_instance_allday_calendar_book.start_time, CALENDAR_MATCH_LESS_THAN_OR_EQUAL, localEndTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Create query
calendar_query_h allDayEventInstanceQueryHandle = null;
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalendarQuery allDayEventInstanceQuery(allDayEventInstanceQueryHandle);
- errorCode = calendar_query_set_sort(allDayEventInstanceQueryHandle, _calendar_instance_allday_calendar_book.start_time, true);
- errorCode = calendar_query_set_filter(allDayEventInstanceQueryHandle, allDayEventInstanceMainFilterHandle);
+ calendar_query_set_sort(allDayEventInstanceQueryHandle, _calendar_instance_allday_calendar_book.start_time, true);
+ calendar_query_set_filter(allDayEventInstanceQueryHandle, allDayEventInstanceMainFilterHandle);
int startIndex = (pageNo - 1) * countPerPage;
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
int count = 0;
- errorCode = calendar_list_get_count(allDayEventInstanceListHandle, &count);
+ calendar_list_get_count(allDayEventInstanceListHandle, &count);
int pageCount = allDayEventInstanceCount / countPerPage;
int remainingCount = countPerPage - count;
- errorCode = calendar_list_first(allDayEventInstanceListHandle);
+ calendar_list_first(allDayEventInstanceListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(allDayEventInstanceListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(allDayEventInstanceListHandle, &tmpRecordHandle);
std::unique_ptr<CalEvent> pTmpEventInstance(_CalendarbookImpl::ConvertAllDayEventInstanceHandleToCalEventN(tmpRecordHandle));
SysTryReturn(NID_SCL, pTmpEventInstance != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pList->Add(*pTmpEventInstance.release());
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_next(allDayEventInstanceListHandle);
+ calendar_list_next(allDayEventInstanceListHandle);
}
if (remainingCount > 0)
// Condition : End time of the item > start time of filter
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.end_time, CALENDAR_MATCH_GREATER_THAN, startTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Start time of the item < end time of filter
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.start_time, CALENDAR_MATCH_LESS_THAN, endTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(nonAllDayEventInstanceMainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Start time of the item = start time of filter AND Start time of the item = end time of filter
errorCode = calendar_filter_create(_calendar_instance_normal_calendar_book._uri, &subFilterHandle);
subFilterHandle = null;
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.start_time, CALENDAR_MATCH_EQUAL, startTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.start_time, CALENDAR_MATCH_EQUAL, endTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_operator(nonAllDayEventInstanceMainFilterHandle, CALENDAR_FILTER_OPERATOR_OR);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(nonAllDayEventInstanceMainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Create query
calendar_query_h nonAllDayEventInstanceQueryHandle = null;
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalendarQuery nonAllDayEventInstanceQuery(nonAllDayEventInstanceQueryHandle);
- errorCode = calendar_query_set_sort(nonAllDayEventInstanceQueryHandle, _calendar_instance_normal_calendar_book.start_time, true);
- errorCode = calendar_query_set_filter(nonAllDayEventInstanceQueryHandle, nonAllDayEventInstanceMainFilterHandle);
+ calendar_query_set_sort(nonAllDayEventInstanceQueryHandle, _calendar_instance_normal_calendar_book.start_time, true);
+ calendar_query_set_filter(nonAllDayEventInstanceQueryHandle, nonAllDayEventInstanceMainFilterHandle);
if (remainingCount == countPerPage)
{
_CalendarList nonAllDayEventList(nonAllDayEventInstanceListHandle);
count = 0;
- errorCode = calendar_list_get_count(nonAllDayEventInstanceListHandle, &count);
- errorCode = calendar_list_first(nonAllDayEventInstanceListHandle);
+ calendar_list_get_count(nonAllDayEventInstanceListHandle, &count);
+ calendar_list_first(nonAllDayEventInstanceListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(nonAllDayEventInstanceListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(nonAllDayEventInstanceListHandle, &tmpRecordHandle);
std::unique_ptr<CalEvent> pTmpEventInstance(_CalendarbookImpl::ConvertNonAllDayEventInstanceHandleToCalEventN(tmpRecordHandle));
SysTryReturn(NID_SCL, pTmpEventInstance != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pList->Add(*pTmpEventInstance.release());
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_next(nonAllDayEventInstanceListHandle);
+ calendar_list_next(nonAllDayEventInstanceListHandle);
}
}
// Condition : End time of the item > start time of filter
errorCode = calendar_filter_add_caltime(allDayEventInstanceMainFilterHandle, _calendar_instance_allday_calendar_book.end_time, CALENDAR_MATCH_GREATER_THAN_OR_EQUAL, localStartTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Start time of the item < end time of filter
errorCode = calendar_filter_add_operator(allDayEventInstanceMainFilterHandle, CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(allDayEventInstanceMainFilterHandle, _calendar_instance_allday_calendar_book.start_time, CALENDAR_MATCH_LESS_THAN_OR_EQUAL, localEndTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Create query
calendar_query_h allDayEventInstanceQueryHandle = null;
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalendarQuery allDayEventInstanceQuery(allDayEventInstanceQueryHandle);
- errorCode = calendar_query_set_sort(allDayEventInstanceQueryHandle, _calendar_instance_allday_calendar_book.start_time, true);
- errorCode = calendar_query_set_filter(allDayEventInstanceQueryHandle, allDayEventInstanceMainFilterHandle);
+ calendar_query_set_sort(allDayEventInstanceQueryHandle, _calendar_instance_allday_calendar_book.start_time, true);
+ calendar_query_set_filter(allDayEventInstanceQueryHandle, allDayEventInstanceMainFilterHandle);
// Generate event : category map
std::unique_ptr< HashMapT<int, int> > pEventCategoryMap(GenerateEventCategoryMapN());
int remainingCount = countPerPage;
int candidateCount = 0;
int count = 0;
- errorCode = calendar_list_get_count(allDayEventInstanceListHandle, &count);
- errorCode = calendar_list_first(allDayEventInstanceListHandle);
+ calendar_list_get_count(allDayEventInstanceListHandle, &count);
+ calendar_list_first(allDayEventInstanceListHandle);
for (int i = 0; i < count && remainingCount > 0; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(allDayEventInstanceListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(allDayEventInstanceListHandle, &tmpRecordHandle);
int tmpCategory = EVENT_CATEGORY_ALL;
int eventId = -1;
- errorCode = calendar_record_get_int(tmpRecordHandle, _calendar_instance_allday_calendar_book.event_id, &eventId);
+ calendar_record_get_int(tmpRecordHandle, _calendar_instance_allday_calendar_book.event_id, &eventId);
pEventCategoryMap->GetValue(eventId, tmpCategory);
if (tmpCategory == category)
candidateCount++;
}
- errorCode = calendar_list_next(allDayEventInstanceListHandle);
+ calendar_list_next(allDayEventInstanceListHandle);
}
if (remainingCount > 0)
// Condition : End time of the item > start time of filter
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.end_time, CALENDAR_MATCH_GREATER_THAN, startTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Start time of the item < end time of filter
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.start_time, CALENDAR_MATCH_LESS_THAN, endTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(nonAllDayEventInstanceMainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Condition : Start time of the item = start time of filter AND Start time of the item = end time of filter
errorCode = calendar_filter_create(_calendar_instance_normal_calendar_book._uri, &subFilterHandle);
subFilterHandle = null;
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.start_time, CALENDAR_MATCH_EQUAL, startTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_operator(subFilter.GetHandle(), CALENDAR_FILTER_OPERATOR_AND);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_caltime(subFilter.GetHandle(), _calendar_instance_normal_calendar_book.start_time, CALENDAR_MATCH_EQUAL, endTime);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_operator(nonAllDayEventInstanceMainFilterHandle, CALENDAR_FILTER_OPERATOR_OR);
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
errorCode = calendar_filter_add_filter(nonAllDayEventInstanceMainFilterHandle, subFilter.GetHandle());
+ SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
// Create query
calendar_query_h nonAllDayEventInstanceQueryHandle = null;
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalendarQuery nonAllDayEventInstanceQuery(nonAllDayEventInstanceQueryHandle);
- errorCode = calendar_query_set_sort(nonAllDayEventInstanceQueryHandle, _calendar_instance_normal_calendar_book.start_time, true);
- errorCode = calendar_query_set_filter(nonAllDayEventInstanceQueryHandle, nonAllDayEventInstanceMainFilterHandle);
+ calendar_query_set_sort(nonAllDayEventInstanceQueryHandle, _calendar_instance_normal_calendar_book.start_time, true);
+ calendar_query_set_filter(nonAllDayEventInstanceQueryHandle, nonAllDayEventInstanceMainFilterHandle);
if (remainingCount == countPerPage)
{
candidateCount = 0;
count = 0;
- errorCode = calendar_list_get_count(nonAllDayEventInstanceListHandle, &count);
- errorCode = calendar_list_first(nonAllDayEventInstanceListHandle);
+ calendar_list_get_count(nonAllDayEventInstanceListHandle, &count);
+ calendar_list_first(nonAllDayEventInstanceListHandle);
for (int i = 0; i < count && remainingCount > 0; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(nonAllDayEventInstanceListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(nonAllDayEventInstanceListHandle, &tmpRecordHandle);
int tmpCategory = EVENT_CATEGORY_ALL;
int eventId = -1;
- errorCode = calendar_record_get_int(tmpRecordHandle, _calendar_instance_normal_calendar_book.event_id, &eventId);
+ calendar_record_get_int(tmpRecordHandle, _calendar_instance_normal_calendar_book.event_id, &eventId);
pEventCategoryMap->GetValue(eventId, tmpCategory);
if (tmpCategory == category)
candidateCount++;
}
- errorCode = calendar_list_next(nonAllDayEventInstanceListHandle);
+ calendar_list_next(nonAllDayEventInstanceListHandle);
}
}
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
_CalendarQuery query(queryHandle);
- errorCode = calendar_query_set_projection(queryHandle, projectionList, _NUMBER_OF_EVENT_CATEGORY_MAP_PROJECTION);
- errorCode = calendar_query_set_sort(queryHandle, _calendar_event.id, true);
+ calendar_query_set_projection(queryHandle, projectionList, _NUMBER_OF_EVENT_CATEGORY_MAP_PROJECTION);
+ calendar_query_set_sort(queryHandle, _calendar_event.id, true);
calendar_list_h calendarListHandle = null;
errorCode = calendar_db_get_records_with_query(queryHandle, 0, 0, &calendarListHandle);
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
int count = 0;
- errorCode = calendar_list_get_count(calendarListHandle, &count);
- errorCode = calendar_list_first(calendarListHandle);
+ calendar_list_get_count(calendarListHandle, &count);
+ calendar_list_first(calendarListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(calendarListHandle, &tmpRecordHandle);
int eventId = -1;
char* pCategories = null;
- errorCode = calendar_record_get_int(tmpRecordHandle, _calendar_event.id, &eventId);
- errorCode = calendar_record_get_str_p(tmpRecordHandle, _calendar_event.categories, &pCategories);
+ calendar_record_get_int(tmpRecordHandle, _calendar_event.id, &eventId);
+ calendar_record_get_str_p(tmpRecordHandle, _calendar_event.categories, &pCategories);
int category = _CalendarbookUtil::ConvertCSCategoriesToEventCategory(pCategories);
pEventCategoryMap->Add(eventId, category);
- errorCode = calendar_list_next(calendarListHandle);
+ calendar_list_next(calendarListHandle);
}
return pEventCategoryMap.release();
errorCode = calendar_db_get_record(_calendar_book._uri, calendarId, &calendarHandle);
SysTryReturn(NID_SCL, errorCode == CALENDAR_ERROR_NONE, CALENDAR_ITEM_TYPE_EVENT_AND_TODO, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.");
- errorCode = calendar_record_get_int(calendarHandle, _calendar_book.store_type, &storeType);
+ calendar_record_get_int(calendarHandle, _calendar_book.store_type, &storeType);
if (storeType == (CALENDAR_BOOK_TYPE_EVENT | CALENDAR_BOOK_TYPE_TODO))
{
calendar_time_s startCalendarTime;
calendar_time_s endCalendarTime;
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.start_time, &startCalendarTime);
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.end_time, &endCalendarTime);
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.start_time, startCalendarTime);
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.end_time, endCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.start_time, &startCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.end_time, &endCalendarTime);
+ calendar_record_set_caltime(eventHandle, _calendar_event.start_time, startCalendarTime);
+ calendar_record_set_caltime(eventHandle, _calendar_event.end_time, endCalendarTime);
pEventImpl->SetOriginalCalEventId(originalEventDBId);
pEventImpl->SetRecordHandle(eventHandle);
calendar_time_s startCalendarTime;
calendar_time_s endCalendarTime;
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.start_time, &startCalendarTime);
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.end_time, &endCalendarTime);
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.start_time, startCalendarTime);
- errorCode = calendar_record_set_caltime(eventHandle, _calendar_event.end_time, endCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.start_time, &startCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.end_time, &endCalendarTime);
+ calendar_record_set_caltime(eventHandle, _calendar_event.start_time, startCalendarTime);
+ calendar_record_set_caltime(eventHandle, _calendar_event.end_time, endCalendarTime);
pEventImpl->SetOriginalCalEventId(originalEventDBId);
pEventImpl->SetRecordHandle(eventHandle);
CalEventInstance*
_CalendarbookImpl::ConvertAllDayEventInstanceHandleToCalEventInstanceN(calendar_record_h instanceHandle)
{
- int errorCode = CALENDAR_ERROR_NONE;
-
ClearLastResult();
std::unique_ptr<CalEventInstance> pEventInstance(new (std::nothrow) CalEventInstance());
_CalEventInstanceImpl* pEventInstanceImpl = _CalEventInstanceImpl::GetInstance(*pEventInstance.get());
int originalEventDBId = _INVALID_EVENT_DB_ID;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.event_id, &originalEventDBId);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.event_id, &originalEventDBId);
pEventInstanceImpl->SetOriginalEventId(originalEventDBId);
int calendarDBId = _INVALID_CALENDARBOOK_DB_ID;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.calendar_book_id, &calendarDBId);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.calendar_book_id, &calendarDBId);
pEventInstanceImpl->SetCalendarId(calendarDBId);
int srcEventBusyStatus = CALENDAR_EVENT_BUSY_STATUS_FREE;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.busy_status, &srcEventBusyStatus);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.busy_status, &srcEventBusyStatus);
BusyStatus busyStatus = BUSY_STATUS_FREE;
switch (srcEventBusyStatus)
{
pEventInstanceImpl->SetBusyStatus(busyStatus);
int srcEventStatus = CALENDAR_EVENT_STATUS_NONE;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.event_status, &srcEventStatus);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.event_status, &srcEventStatus);
EventStatus eventStatus = EVENT_STATUS_NONE;
switch (srcEventStatus)
{
pEventInstanceImpl->SetStatus(eventStatus);
int srcPriority = CALENDAR_EVENT_PRIORITY_NORMAL;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.priority, &srcPriority);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.priority, &srcPriority);
EventPriority priority = EVENT_PRIORITY_NORMAL;
switch (srcPriority)
{
pEventInstanceImpl->SetPriority(priority);
int srcSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.sensitivity, &srcSensitivity);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.sensitivity, &srcSensitivity);
RecordSensitivity sensitivity = SENSITIVITY_PUBLIC;
switch (srcSensitivity)
{
calendar_time_s startCalendarTime;
DateTime tmpStartTime;
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.start_time, &startCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.start_time, &startCalendarTime);
tmpStartTime.SetValue(startCalendarTime.time.date.year, startCalendarTime.time.date.month, startCalendarTime.time.date.mday);
pEventInstanceImpl->SetStartTime(tmpStartTime);
calendar_time_s endCalendarTime;
DateTime tmpEndTime;
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.end_time, &endCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_allday_calendar_book.end_time, &endCalendarTime);
tmpEndTime.SetValue(endCalendarTime.time.date.year, endCalendarTime.time.date.month, endCalendarTime.time.date.mday);
pEventInstanceImpl->SetEndTime(tmpEndTime);
pEventInstanceImpl->SetAllDayEvent(true);
int isRecurring = 0;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.has_rrule, &isRecurring);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.has_rrule, &isRecurring);
pEventInstanceImpl->SetRecurring(isRecurring);
int hasReminder = 0;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.has_alarm, &hasReminder);
+ calendar_record_get_int(instanceHandle, _calendar_instance_allday_calendar_book.has_alarm, &hasReminder);
pEventInstanceImpl->SetHasReminder(hasReminder);
char* pSubject = null;
- errorCode = calendar_record_get_str_p(instanceHandle, _calendar_instance_allday_calendar_book.summary, &pSubject);
+ calendar_record_get_str_p(instanceHandle, _calendar_instance_allday_calendar_book.summary, &pSubject);
pEventInstanceImpl->SetSubject(pSubject);
char* pDescription = null;
- errorCode = calendar_record_get_str_p(instanceHandle, _calendar_instance_allday_calendar_book.description, &pDescription);
+ calendar_record_get_str_p(instanceHandle, _calendar_instance_allday_calendar_book.description, &pDescription);
pEventInstanceImpl->SetDescription(pDescription);
char* pLocation = null;
- errorCode = calendar_record_get_str_p(instanceHandle, _calendar_instance_allday_calendar_book.location, &pLocation);
+ calendar_record_get_str_p(instanceHandle, _calendar_instance_allday_calendar_book.location, &pLocation);
pEventInstanceImpl->SetLocation(pLocation);
return pEventInstance.release();
CalEventInstance*
_CalendarbookImpl::ConvertNonAllDayEventInstanceHandleToCalEventInstanceN(calendar_record_h instanceHandle)
{
- int errorCode = CALENDAR_ERROR_NONE;
-
ClearLastResult();
std::unique_ptr<CalEventInstance> pEventInstance(new (std::nothrow) CalEventInstance());
_CalEventInstanceImpl* pEventInstanceImpl = _CalEventInstanceImpl::GetInstance(*pEventInstance.get());
int originalEventDBId = _INVALID_EVENT_DB_ID;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.event_id, &originalEventDBId);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.event_id, &originalEventDBId);
pEventInstanceImpl->SetOriginalEventId(originalEventDBId);
int calendarDBId = _INVALID_CALENDARBOOK_DB_ID;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.calendar_book_id, &calendarDBId);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.calendar_book_id, &calendarDBId);
pEventInstanceImpl->SetCalendarId(calendarDBId);
int srcEventBusyStatus = CALENDAR_EVENT_BUSY_STATUS_FREE;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.busy_status, &srcEventBusyStatus);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.busy_status, &srcEventBusyStatus);
BusyStatus busyStatus = BUSY_STATUS_FREE;
switch (srcEventBusyStatus)
{
pEventInstanceImpl->SetBusyStatus(busyStatus);
int srcEventStatus = CALENDAR_EVENT_STATUS_NONE;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.event_status, &srcEventStatus);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.event_status, &srcEventStatus);
EventStatus eventStatus = EVENT_STATUS_NONE;
switch (srcEventStatus)
pEventInstanceImpl->SetStatus(eventStatus);
int srcPriority = CALENDAR_EVENT_PRIORITY_NORMAL;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.priority, &srcPriority);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.priority, &srcPriority);
EventPriority priority = EVENT_PRIORITY_NORMAL;
switch (srcPriority)
{
pEventInstanceImpl->SetPriority(priority);
int srcSensitivity = CALENDAR_SENSITIVITY_PUBLIC;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.sensitivity, &srcSensitivity);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.sensitivity, &srcSensitivity);
RecordSensitivity sensitivity = SENSITIVITY_PUBLIC;
switch (srcSensitivity)
{
calendar_time_s startCalendarTime;
DateTime tmpStartTime;
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.start_time, &startCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.start_time, &startCalendarTime);
tmpStartTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(startCalendarTime.time.utime);
pEventInstanceImpl->SetStartTime(tmpStartTime);
calendar_time_s endCalendarTime;
DateTime tmpEndTime;
- errorCode = calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.end_time, &endCalendarTime);
+ calendar_record_get_caltime(instanceHandle, _calendar_instance_normal_calendar_book.end_time, &endCalendarTime);
tmpEndTime = _CalendarbookUtil::ConvertEpochTimeToDateTime(endCalendarTime.time.utime);
pEventInstanceImpl->SetEndTime(tmpEndTime);
pEventInstanceImpl->SetAllDayEvent(false);
int isRecurring = 0;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.has_rrule, &isRecurring);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.has_rrule, &isRecurring);
pEventInstanceImpl->SetRecurring(isRecurring);
int hasReminder = 0;
- errorCode = calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.has_alarm, &hasReminder);
+ calendar_record_get_int(instanceHandle, _calendar_instance_normal_calendar_book.has_alarm, &hasReminder);
pEventInstanceImpl->SetHasReminder(hasReminder);
char* pSubject = null;
- errorCode = calendar_record_get_str_p(instanceHandle, _calendar_instance_normal_calendar_book.summary, &pSubject);
+ calendar_record_get_str_p(instanceHandle, _calendar_instance_normal_calendar_book.summary, &pSubject);
pEventInstanceImpl->SetSubject(pSubject);
char* pDescription = null;
- errorCode = calendar_record_get_str_p(instanceHandle, _calendar_instance_normal_calendar_book.description, &pDescription);
+ calendar_record_get_str_p(instanceHandle, _calendar_instance_normal_calendar_book.description, &pDescription);
pEventInstanceImpl->SetDescription(pDescription);
char* pLocation = null;
- errorCode = calendar_record_get_str_p(instanceHandle, _calendar_instance_normal_calendar_book.location, &pLocation);
+ calendar_record_get_str_p(instanceHandle, _calendar_instance_normal_calendar_book.location, &pLocation);
pEventInstanceImpl->SetLocation(pLocation);
return pEventInstance.release();
CalEventChangeInfo*
_CalendarbookImpl::ConvertModifiedEventToCalEventChangeInfoN(calendar_record_h modifiedEventHandle)
{
- int errorCode = CALENDAR_ERROR_NONE;
-
ClearLastResult();
std::unique_ptr<CalEventChangeInfo> pEventChangeInfo(new (std::nothrow) CalEventChangeInfo());
_CalEventChangeInfoImpl* pEventChangeInfoImpl = _CalEventChangeInfoImpl::GetInstance(*pEventChangeInfo.get());
int eventId = 0;
- errorCode = calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.id, &eventId);
+ calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.id, &eventId);
pEventChangeInfoImpl->SetEventId(eventId);
int calendarbookId = 0;
- errorCode = calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.calendar_book_id, &calendarbookId);
+ calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.calendar_book_id, &calendarbookId);
pEventChangeInfoImpl->SetCalendarId(calendarbookId);
int modifiedStatus = CALENDAR_RECORD_MODIFIED_STATUS_INSERTED;
- errorCode = calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.modified_status, &modifiedStatus);
+ calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.modified_status, &modifiedStatus);
RecordChangeType recordChangeType = RECORD_CHANGE_TYPE_ADDED;
switch (modifiedStatus)
{
pEventChangeInfoImpl->SetChangeType(recordChangeType);
int version = 0;
- errorCode = calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.version, &version);
+ calendar_record_get_int(modifiedEventHandle, _calendar_updated_info.version, &version);
pEventChangeInfoImpl->SetVersion(version);
return pEventChangeInfo.release();
CalTodoChangeInfo*
_CalendarbookImpl::ConvertModifiedTodoToCalTodoChangeInfoN(calendar_record_h modifiedTodoHandle)
{
- int errorCode = CALENDAR_ERROR_NONE;
-
ClearLastResult();
std::unique_ptr<CalTodoChangeInfo> pTodoChangeInfo(new (std::nothrow) CalTodoChangeInfo());
_CalTodoChangeInfoImpl* pTodoChangeInfoImpl = _CalTodoChangeInfoImpl::GetInstance(*pTodoChangeInfo.get());
int todoId = 0;
- errorCode = calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.id, &todoId);
+ calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.id, &todoId);
pTodoChangeInfoImpl->SetTodoId(todoId);
int calendarbookId = 0;
- errorCode = calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.calendar_book_id, &calendarbookId);
+ calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.calendar_book_id, &calendarbookId);
pTodoChangeInfoImpl->SetCalendarId(calendarbookId);
int modifiedStatus = CALENDAR_RECORD_MODIFIED_STATUS_INSERTED;
- errorCode = calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.modified_status, &modifiedStatus);
+ calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.modified_status, &modifiedStatus);
RecordChangeType recordChangeType = RECORD_CHANGE_TYPE_ADDED;
switch (modifiedStatus)
pTodoChangeInfoImpl->SetChangeType(recordChangeType);
int version = 0;
- errorCode = calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.version, &version);
+ calendar_record_get_int(modifiedTodoHandle, _calendar_updated_info.version, &version);
pTodoChangeInfoImpl->SetVersion(version);
return pTodoChangeInfo.release();
IList*
_CalendarbookImpl::ConvertRecordListN(calendar_list_h resultListHandle, RecordView recordView)
{
- int errorCode = CALENDAR_ERROR_NONE;
result r = E_SUCCESS;
std::unique_ptr<ArrayList, AllElementsDeleter> pList(new (std::nothrow) ArrayList());
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(resultListHandle, &count);
+ calendar_list_get_count(resultListHandle, &count);
for (int i = 0; i < count; i++)
{
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
- errorCode = calendar_list_first(resultListHandle);
+ calendar_list_first(resultListHandle);
std::unique_ptr<IEnumerator> pEnum(pList->GetEnumeratorN());
while (pEnum->MoveNext() == E_SUCCESS)
{
RecordType* pTmpRecord = static_cast<RecordType*>(pEnum->GetCurrent());
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(resultListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(resultListHandle, &tmpRecordHandle);
RecordTypeImpl::GetInstance(*pTmpRecord)->SetRecordHandle(tmpRecordHandle);
int dbIndex = -1;
- errorCode = calendar_record_get_int(tmpRecordHandle, recordView.id, &dbIndex);
+ calendar_record_get_int(tmpRecordHandle, recordView.id, &dbIndex);
_RecordImpl::GetInstance(*pTmpRecord)->SetRecordId(dbIndex);
- errorCode = calendar_list_next(resultListHandle);
+ calendar_list_next(resultListHandle);
}
return pList.release();
IList*
_CalendarbookImpl::ConvertEventInstanceListN(calendar_list_h resultListHandle, bool isAllDay)
{
- int errorCode = CALENDAR_ERROR_NONE;
result r = E_SUCCESS;
std::unique_ptr<ArrayList, AllElementsDeleter> pList(new (std::nothrow) ArrayList());
SysTryReturn(NID_SCL, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
int count = 0;
- errorCode = calendar_list_get_count(resultListHandle, &count);
- errorCode = calendar_list_first(resultListHandle);
+ calendar_list_get_count(resultListHandle, &count);
+ calendar_list_first(resultListHandle);
for (int i = 0; i < count; i++)
{
calendar_record_h tmpRecordHandle = null;
- errorCode = calendar_list_get_current_record_p(resultListHandle, &tmpRecordHandle);
+ calendar_list_get_current_record_p(resultListHandle, &tmpRecordHandle);
std::unique_ptr<CalEventInstance> pTmpEventInstance;
r = pList->Add(*pTmpEventInstance.release());
SysTryReturn(NID_SCL, r == E_SUCCESS, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- errorCode = calendar_list_next(resultListHandle);
+ calendar_list_next(resultListHandle);
}
return pList.release();