calendarui/views/src/caleneventviewcontainer.cpp
branchRCL_3
changeset 20 21239b3bcd78
parent 13 0f07cd1b5772
child 21 9711e452b5e9
--- a/calendarui/views/src/caleneventviewcontainer.cpp	Wed Mar 31 21:29:10 2010 +0300
+++ b/calendarui/views/src/caleneventviewcontainer.cpp	Wed Apr 14 15:55:57 2010 +0300
@@ -118,7 +118,8 @@
     : CCalenContainer( aView, aServices ),
     					  iEntry(NULL),
     					  iAutomaticHlValue(ETrue),
-    					  iAutomaticHlInitialized(EFalse)
+    					  iAutomaticHlInitialized(EFalse),
+    					  iEmbeddedFileOpened(EFalse)
     {
 	TRACE_ENTRY_POINT;
 	iNumOfLinesBeforeLocField = 0;
@@ -561,7 +562,7 @@
     			iTextEditor->SetFocus(ETrue);
     			
     			// TODO: Uncomment this when enabling attachment support
-    			if(iEventViewData)
+    			if(iEventViewData && !iEmbeddedFileOpened)
     			    {
     		
     			    if(iEventViewData->AttachmentCount())
@@ -2786,6 +2787,7 @@
     {
     TRACE_ENTRY_POINT;
     
+    iEmbeddedFileOpened = EFalse;
     if (aReason == EAknCmdExit)
         {
         //issue this notification, which will be handled by attachmentui.
@@ -2953,18 +2955,29 @@
     
     if(datatype == KNotePadTextDataType())
         {
+        if(iEmbeddedFileOpened)
+            {
+            return;
+            }
+        iEmbeddedFileOpened = ETrue; 
         const TDesC& notepadTitle = _L("NotePad");
         ret = CNotepadApi::ExecFileViewerL( aFile, 
                                            &notepadTitle,
                                            ETrue,
                                            ETrue,
                                            KCharacterSetIdentifierIso88591 );
+        iEmbeddedFileOpened = EFalse;
         
         }
     else
         {
         //doc handler will open the other files (other than text file).
         TRAP( ret, iDocHandler->OpenFileEmbeddedL( aFile, datatype ) );
+        
+        if(ret == KErrNone)
+            {
+            iEmbeddedFileOpened = ETrue;
+            }
         }
     
     switch(ret)