calendarui/controller/src/calenviewattachmentsdialog.cpp
branchRCL_3
changeset 20 21239b3bcd78
parent 12 38571fd2a704
child 67 1539a383d7b6
--- a/calendarui/controller/src/calenviewattachmentsdialog.cpp	Wed Mar 31 21:29:10 2010 +0300
+++ b/calendarui/controller/src/calenviewattachmentsdialog.cpp	Wed Apr 14 15:55:57 2010 +0300
@@ -105,7 +105,8 @@
       CCalenAttachmentModel& aAttachmentModel,CCalenController& aController )
     : iAttachmentModel( aAttachmentModel ),
       iController(aController),
-      iNewTitle( aTitle )  
+      iNewTitle( aTitle ),
+      iEmbeddedFileOpened(EFalse)  
     {
     TRACE_ENTRY_POINT;
     TRACE_EXIT_POINT;
@@ -392,6 +393,7 @@
     {
     TRACE_ENTRY_POINT;
     
+    iEmbeddedFileOpened = EFalse;
     if (aReason == EAknCmdExit)
         {
         //issue this notification, which will be handled by attachmentui.
@@ -798,7 +800,7 @@
     {
     TRACE_ENTRY_POINT;
      //Single click integration
-    if ( iListBox )
+    if ( iListBox && !iEmbeddedFileOpened)
         {
         iListBox->HandlePointerEventL( aPointerEvent );
         }
@@ -1098,18 +1100,27 @@
     
     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)