uifw/AvKon/src/AknAdaptiveSearchGrid.cpp
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 16 71dd06cfe933
child 23 3d340a0166ff
--- a/uifw/AvKon/src/AknAdaptiveSearchGrid.cpp	Wed Apr 14 16:14:00 2010 +0300
+++ b/uifw/AvKon/src/AknAdaptiveSearchGrid.cpp	Tue Apr 27 16:55:05 2010 +0300
@@ -124,8 +124,11 @@
     { 
     _AKNTRACE_FUNC_ENTER;
     CEikonEnv::Static()->EikAppUi()->RemoveFromStack( this );
-    delete iBgContextOfControlPane;
- 
+    if ( iBgContextOfControlPane )
+    	{
+		delete iBgContextOfControlPane;
+		iBgContextOfControlPane = NULL;
+    	}
     // Clear current region of AS
     iCurrentRegion.Clear();    
     iButtonArray.ResetAndDestroy();
@@ -161,9 +164,12 @@
         iPageIndicator = NULL;
         }
        
-    CAknWsEventMonitor* eventMonitor = iAppUi->EventMonitor();    
-    eventMonitor->Enable( EFalse ); 
-    eventMonitor->RemoveObserver( this ); 
+    if ( iAppUi )
+        {
+        CAknWsEventMonitor* eventMonitor = iAppUi->EventMonitor();  
+        eventMonitor->Enable( EFalse ); 
+        eventMonitor->RemoveObserver( this ); 
+        }
     _AKNTRACE_FUNC_EXIT;
     }
 
@@ -630,7 +636,7 @@
 // The position of the top left corner should be set in advance.
 // -----------------------------------------------------------------------------
 //
-void CAknAdaptiveSearchGrid::SetVisibilityL( TBool aVisible, TBool aSelectAll )
+void CAknAdaptiveSearchGrid::SetVisibilityL( TBool aVisible, TBool /*aSelectAll*/ )
     {
     _AKNTRACE( "[%s][%s] Visible : %d", "CAknAdaptiveSearchGrid", __FUNCTION__, aVisible );
     if ( aVisible )
@@ -1122,7 +1128,7 @@
 // This function is called whenever a control gains or loses focus.
 // -----------------------------------------------------------------------------
 // 
-void CAknAdaptiveSearchGrid::FocusChanged( TDrawNow aDrawNow )
+void CAknAdaptiveSearchGrid::FocusChanged( TDrawNow /*aDrawNow*/ )
     {
     if ( !iShown || IsNonFocusing() )
         {
@@ -1643,7 +1649,7 @@
         
 
 // -----------------------------------------------------------------------------
-// CCAknAdaptiveSearch::SaveFindPaneRect()
+// CAknAdaptiveSearch::SaveFindPaneRect()
 // When the rect of find pane is set, this functions will be notified
 // to record the size of it.
 // -----------------------------------------------------------------------------
@@ -1652,11 +1658,15 @@
     {
     //When width is zero, no need to deal with.
     if ( 0 == aRect.Size().iWidth )
+        {
         return;
+        }
     
     //The same size already is set. No need to do further process.
-    if ( aRect.Size().iWidth == iFindpaneRect.Size().iWidth )
+    if ( aRect == iFindpaneRect )
+        {
         return;    
+        }
 
     iFindpaneRect = aRect;
     iFindPaneSizeChanged = ETrue;