pimappservices/calendar/server/src/agsentrymodel.cpp
branchRCL_3
changeset 13 0f07cd1b5772
parent 12 38571fd2a704
child 30 d68a4b5d5885
--- a/pimappservices/calendar/server/src/agsentrymodel.cpp	Fri Mar 12 15:42:35 2010 +0200
+++ b/pimappservices/calendar/server/src/agsentrymodel.cpp	Mon Mar 15 12:40:18 2010 +0200
@@ -511,9 +511,11 @@
 				_DBGLOG_VERBOSE(AgmDebug::DebugLog("StoreL: Existing entry types is different to incoming entry's type");)
 				_DBGLOG_VERBOSE(AgmDebug::DebugLog("StoreL: Delete the existing entry and add the incoming entry as a new one");)
 				
-				// if the entry is a different type, delete the old entry and add the new one 
+				// if the entry is a different type, add the new one first and delete only later
+                // This change is needed if the entry having attachments, it will be shared by two 
+                //entries, so that attachments will not be deleted, while deleting it later. 
+				returnId = AddEntryL(aEntry);
 				DeleteEntryL(*existingEntryToReplace, ETrue, iChangeFilter);
-				returnId = AddEntryL(aEntry);
 				}
 
 			CleanupStack::PopAndDestroy(existingEntryToReplace);