meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp
branchRCL_3
changeset 60 d620048b4810
parent 24 b5fbb9b25d57
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp	Mon Jun 21 15:20:54 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp	Thu Jul 15 18:19:25 2010 +0300
@@ -133,8 +133,9 @@
     FUNC_LOG;
     SetComponentsToInheritVisibility( ETrue );
 
-    iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAttachment );
-    iFieldIcon->SetParent( this );
+    iFieldIcon = CMRImage::NewL(
+            NMRBitmapManager::EMRBitmapAttachment,
+            this );
 
     iRichTextViewer = CESMRRichTextViewer::NewL( this );
     CESMRField::ConstructL( iRichTextViewer ); // ownership transferred
@@ -283,9 +284,9 @@
     switch ( aInd )
         {
         case 0:
-            return iRichTextViewer;
+            return iFieldIcon;
         case 1:
-            return iFieldIcon;
+            return iRichTextViewer;
         case 2:
         	return iLockIcon;
         default:
@@ -400,23 +401,6 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMRViewerAttachmentsField::SetContainerWindowL()
-// ---------------------------------------------------------------------------
-//
-void CMRViewerAttachmentsField::SetContainerWindowL( const CCoeControl& aControl )
-    {
-    FUNC_LOG;
-    CESMRField::SetContainerWindowL( aControl );
-    iRichTextViewer->SetContainerWindowL( aControl );
-    iRichTextViewer->SetParent( this );
-
-    iFieldIcon->SetContainerWindowL( aControl );
-    iFieldIcon->SetParent( this );
-
-    iButtonGroupContainer = CEikButtonGroupContainer::Current();
-    }
-
-// ---------------------------------------------------------------------------
 // CMRViewerAttachmentsField::HandleEdwinSizeEventL
 // ---------------------------------------------------------------------------
 //
@@ -435,6 +419,11 @@
            {
            iObserver->ControlSizeChanged( this );
            reDraw = ETrue;
+           
+           if ( !iOutlineFocus )
+               {
+               RecordField();
+               }
            }
         }
 
@@ -642,11 +631,6 @@
             iRichTextViewer->SetLineSpacingL( LineSpacing() );
             }
 
-        iRichTextViewer->ApplyLayoutChangesL();
-
-        iRichTextViewer->SetMargins( KMargin ); // What's this?
-        iRichTextViewer->HandleTextChangedL();
-
         while ( attachmentLinks.Count() > 0 )
             {
             CESMRRichTextLink* link = attachmentLinks[0];
@@ -655,6 +639,11 @@
             iRichTextViewer->AddLinkL( link );
             CleanupStack::Pop( link );
             }
+
+        iRichTextViewer->ApplyLayoutChangesL();
+
+        iRichTextViewer->SetMargins( KMargin ); // What's this?
+        iRichTextViewer->HandleTextChangedL();
         }
 
     CleanupStack::PopAndDestroy( &attachmentLinks );
@@ -831,8 +820,10 @@
 
 	delete iLockIcon;
 	iLockIcon = NULL;
-	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
-	iLockIcon->SetParent( this );
+	iLockIcon = CMRImage::NewL(
+	        NMRBitmapManager::EMRBitmapLockField,
+	        this,
+	        ETrue );
 	}
 
 // ---------------------------------------------------------------------------