calendarui/editors/src/calenunifiededitor.cpp
branchRCL_3
changeset 27 55d60436f00b
parent 20 21239b3bcd78
child 30 d68a4b5d5885
--- a/calendarui/editors/src/calenunifiededitor.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/editors/src/calenunifiededitor.cpp	Tue May 11 16:12:24 2010 +0300
@@ -288,7 +288,7 @@
     
     isReplaceLocation = EFalse;
     
-   
+    iCheck = EFalse;
     TCallBack callback(CCalenUnifiedEditor::AsyncProcessCommandL,this);
     iAsyncCallback = new(ELeave) CAsyncCallBack(callback,CActive::EPriorityStandard);
     
@@ -601,6 +601,7 @@
              if( iServices->EntryViewL(colId) )
                  {
                  PIM_TRAPD_HANDLE( TryToSaveNoteOnForcedExitL() );
+                 iCheck = EFalse;
                  }
              if(EAknSoftkeyExit == aButtonId)
                  iServices->IssueCommandL(aButtonId);
@@ -1471,7 +1472,7 @@
 // (other items were commented in a header).
 // -----------------------------------------------------------------------------
 //
-void CCalenUnifiedEditor::TryInsertSendMenuL( TInt aResourceId, CEikMenuPane* aMenuPane )
+void CCalenUnifiedEditor::TryInsertSendMenuL( TInt /*aResourceId*/, CEikMenuPane* aMenuPane )
     {
     TRACE_ENTRY_POINT;
 
@@ -1925,16 +1926,20 @@
         
         TTime startDate = Edited().StartDateTime();
         TTime endDate = Edited().EndDateTime();
+        TTimeIntervalDays differenceInTime = endDate.DaysFrom(startDate); // fix for AllDayEntry issue
         
         if( startDate == CalenDateUtils::BeginningOfDay( startDate ) &&
                 endDate == CalenDateUtils::BeginningOfDay( endDate ) )
             {
-            TTimeIntervalDays differenceInTime = endDate.DaysFrom(startDate); // fix for AllDayEntry issue
             if( CCalEntry::EAppt == Edited().EntryType() && startDate != endDate && differenceInTime.Int() >= 1 )
                 {
                 Edited().SetEntryType( CCalEntry::EEvent );
                 }
             }
+        if(differenceInTime.Int() == 0 && (CCalEntry::EAppt == Edited().EntryType() || CCalEntry::EEvent == Edited().EntryType()))
+            {
+            Edited().SetEntryType( CCalEntry::EAppt ); //changed
+            }
         
         switch ( EditorDataHandler().ShouldSaveOrDeleteOrDoNothingL() ) 
             {
@@ -2245,7 +2250,7 @@
 void CCalenUnifiedEditor::TryToSaveNoteOnForcedExitL()
     {
     TRACE_ENTRY_POINT;
-    
+    iCheck = ETrue;
     if( EntryStillExistsL() == EEntryOk )
         {
         if( CheckSpaceBelowCriticalLevelL() )
@@ -3002,6 +3007,7 @@
     if( attachmentCount )
         {
         RPointerArray<HBufC> attachmentNames;
+        CleanupResetAndDestroyPushL(attachmentNames);
         GetAttachmentNamesL(attachmentNames);
         attachmentCount = attachmentNames.Count();            
         TInt attachmentLength(0);        
@@ -3026,7 +3032,7 @@
         
         // Cleanup
         delete attachmentNamesString;
-        attachmentNames.ResetAndDestroy();
+        CleanupStack::PopAndDestroy(&attachmentNames);
         }
     
     TRACE_EXIT_POINT;