delete __pEvent;
__pEvent = new (std::nothrow) CalEvent(event);
+ if (__pEvent->GetBaseEventId() != __pEvent->GetRecordId() && __pEvent->GetBaseEventId() != INVALID_RECORD_ID)
+ {
+ CalEvent* pBaseEvent = __pCalendarbook->GetEventN(__pEvent->GetBaseEventId());
+ if (pBaseEvent != null)
+ {
+ delete __pRecurrence;
+ __pRecurrence = new (std::nothrow) Recurrence(*pBaseEvent->GetRecurrence());
+ delete pBaseEvent;
+ }
+ }
+
delete __pCalendar;
if (__pEvent->GetCalendarId() != INVALID_RECORD_ID)
{
delete __pEvent;
__pEvent = pEvent;
+ if (__pEvent->GetBaseEventId() != __pEvent->GetRecordId() && __pEvent->GetBaseEventId() != INVALID_RECORD_ID)
+ {
+ CalEvent* pBaseEvent = __pCalendarbook->GetEventN(__pEvent->GetBaseEventId());
+ if (pBaseEvent != null)
+ {
+ delete __pRecurrence;
+ __pRecurrence = new (std::nothrow) Recurrence(*pBaseEvent->GetRecurrence());
+ delete pBaseEvent;
+ }
+ }
+
delete __pCalendar;
if (__pEvent->GetCalendarId() != INVALID_RECORD_ID)
{
{
delete __pRecurrence;
__pRecurrence = (pEvent->GetRecurrence() != null) ? new (std::nothrow) Recurrence(*pEvent->GetRecurrence()) : null;
+
pEvent->SetRecurrence(null);
pEvent->SetStartAndEndTime(__pEventInstance->GetStartTime(), __pEventInstance->GetEndTime());
}
delete __pEvent;
__pEvent = pEvent;
+ if (__pEvent->GetBaseEventId() != __pEvent->GetRecordId() && __pEvent->GetBaseEventId() != INVALID_RECORD_ID)
+ {
+ CalEvent* pBaseEvent = __pCalendarbook->GetEventN(__pEvent->GetBaseEventId());
+ if (pBaseEvent != null)
+ {
+ delete __pRecurrence;
+ __pRecurrence = new (std::nothrow) Recurrence(*pBaseEvent->GetRecurrence());
+ delete pBaseEvent;
+ }
+ }
+
delete __pCalendar;
if (__pEventInstance->GetCalendarId() != INVALID_RECORD_ID)
{
}
else if (__allEventEditing == true)
{
- RecordId calendarId = (__pEventInstance != null) ? __pEventInstance->GetCalendarId() : __pEvent->GetCalendarId();
- if (__pCalendar != null && calendarId != INVALID_RECORD_ID && __pCalendar->GetRecordId() != calendarId)
+ if (__pEvent->GetBaseEventId() != eventId && __pEvent->GetBaseEventId() != INVALID_RECORD_ID)
{
- if (__pEvent->GetCalendarId() != INVALID_RECORD_ID)
+ __pEventInstance = GetEventInstance();
+ if (__pEventInstance != null)
{
- __pCalendarbook->RemoveEvent(*__pEvent);
+ r = __pCalendarbook->UpdateEventInstance(*__pEventInstance, *__pEvent);
}
else
{
- __pCalendarbook->RemoveEvent(eventId);
+ r = E_FAILURE;
+ AppLogDebug("[E_FAILURE] Unable to get event instance.");
}
-
- r = __pCalendarbook->AddEvent(*__pEvent, __pCalendar->GetRecordId());
}
else
{
- r = __pCalendarbook->UpdateEvent(*__pEvent);
+ RecordId calendarId = (__pEventInstance != null) ? __pEventInstance->GetCalendarId() : __pEvent->GetCalendarId();
+ if (__pCalendar != null && calendarId != INVALID_RECORD_ID && __pCalendar->GetRecordId() != calendarId)
+ {
+ if (__pEvent->GetCalendarId() != INVALID_RECORD_ID)
+ {
+ __pCalendarbook->RemoveEvent(*__pEvent);
+ }
+ else
+ {
+ __pCalendarbook->RemoveEvent(eventId);
+ }
+
+ r = __pCalendarbook->AddEvent(*__pEvent, __pCalendar->GetRecordId());
+ }
+ else
+ {
+ r = __pCalendarbook->UpdateEvent(*__pEvent);
+ }
}
}
else if (__pEventInstance != null)