extras/calcsoft/src/CalcView.cpp
branchRCL_3
changeset 29 9d6a662e71d9
parent 24 10c6e6d6e4d9
--- a/extras/calcsoft/src/CalcView.cpp	Wed Sep 15 12:14:32 2010 +0300
+++ b/extras/calcsoft/src/CalcView.cpp	Wed Oct 13 14:33:39 2010 +0300
@@ -75,7 +75,7 @@
     iCalcDocument = STATIC_CAST(CCalcDocument*, AppUi()->Document());
 
     iCalcDocument->SetCalcView( this );
-
+    CreateContainerL();
     iCalcDocument->LoadStateL();
    
     /******** Initialize the ServiceHandler in the ConstructL *****/
@@ -92,17 +92,12 @@
 // Destructor
 CCalcView::~CCalcView()
     {
-    if ( iContainer )
-        {
-        delete iContainer;
-        iContainer = NULL;
-        }
-
-    if( iServiceHandler )
-        {
-        delete iServiceHandler;
-        iServiceHandler = NULL;
-        }
+    delete iContainer;
+      if(iServiceHandler)
+      {
+            delete iServiceHandler;
+            iServiceHandler = NULL;
+      }
      
      }
 
@@ -1044,13 +1039,8 @@
                  TUid /* aCustomMessageId */,
                  const TDesC8& /* aCustomMessage */)
     {
-    if ( iContainer == NULL )
-        {
-        CreateContainerL();
-        AppUi()->AddToStackL( *this, iContainer );
-        iContainer->ActivateL();
-        } 
-    
+    AppUi()->AddToStackL(*this, iContainer);
+    iContainer->ActivateL();
     }
 
 // ----------------------------------------------------
@@ -1061,11 +1051,9 @@
 //
 void CCalcView::DoDeactivate()
     {
-    if ( iContainer )
+    if (iContainer)
         {
-        AppUi()->RemoveFromStack( iContainer );
-        delete iContainer;
-        iContainer = NULL;
+        AppUi()->RemoveFromStack(iContainer);
         }
     }