calendarui/editors/src/calenunifiededitor.cpp
branchRCL_3
changeset 36 9c5b1510919f
parent 30 d68a4b5d5885
child 48 bf573002ff72
--- a/calendarui/editors/src/calenunifiededitor.cpp	Tue May 25 12:41:10 2010 +0300
+++ b/calendarui/editors/src/calenunifiededitor.cpp	Wed Jun 09 09:40:23 2010 +0300
@@ -1215,7 +1215,9 @@
 TInt CCalenUnifiedEditor::AsyncProcessCommandL( TAny* aThisPtr )
     {
     TInt focusControl( static_cast<CCalenUnifiedEditor*>(aThisPtr)->IdOfFocusControl() );
-    CEikEdwin* edwin = static_cast<CEikEdwin*>( static_cast<CCalenUnifiedEditor*>(aThisPtr)->Control( focusControl ) );  
+    if(focusControl == ECalenEditorDescription)
+        {
+        CEikEdwin* edwin = static_cast<CEikEdwin*>( static_cast<CCalenUnifiedEditor*>(aThisPtr)->Control( focusControl ) );  
         if ( edwin && edwin->Text()->DocumentLength() == 0 )
             {
             static_cast<CCalenUnifiedEditor*>(aThisPtr)->ProcessCommandL(ECalenCmdAddDescription);
@@ -1224,7 +1226,7 @@
             {
             static_cast<CCalenUnifiedEditor*>(aThisPtr)->ProcessCommandL(ECalenCmdShowDescription);
             }
-    
+        }
     return 0;
     }
 
@@ -1912,7 +1914,17 @@
     const TBool continueOnError = EFalse;
     iUnifiedEditorControl->ReadDataFromEditorL( continueOnError );
     
-    TEntryExistenceStatus status = EntryStillExistsL();
+    TEntryExistenceStatus status;
+    
+	if(!IsCreatingNewEntry())
+		{
+        status = EntryStillExistsL();
+		}
+    else
+		{
+		status = EEntryOk;
+		}
+	 
     TTimeIntervalDays aDay(0);
     if( iCurrentDurationDay<aDay )
         {
@@ -3258,7 +3270,8 @@
     TInt attachCount = iServices->GetAttachmentData()->NumberOfItems();
     if( attachCount )
         {    
-        RPointerArray<CCalenAttachmentInfo> attachmentInfoList;      
+        RPointerArray<CCalenAttachmentInfo> attachmentInfoList;  
+		CleanupClosePushL( attachmentInfoList );
         iServices->GetAttachmentData()->GetAttachmentListL(attachmentInfoList);
         for( TInt index =0; index<attachCount; index++ )
             {
@@ -3268,6 +3281,7 @@
             attachmentName->Des().Copy(fileNameParser.NameAndExt());
             aAttachmentNames.Append(attachmentName);
             }
+		CleanupStack::PopAndDestroy( &attachmentInfoList );		
         }
     else
         {