stif/TouchConsoleUI/src/Consolemenus.cpp
branchRCL_3
changeset 12 7e287c5c61f0
parent 0 a03f92240627
child 21 f5d4820de50d
--- a/stif/TouchConsoleUI/src/Consolemenus.cpp	Thu Apr 01 00:00:49 2010 +0300
+++ b/stif/TouchConsoleUI/src/Consolemenus.cpp	Wed Apr 14 17:35:04 2010 +0300
@@ -476,13 +476,16 @@
             {
             // If in the beginning of the list
 
-            iLast = iItemCount - 1;
-            iFirst = iLast - iScreenSize;
-            if ( iFirst < 0 )
-            	{
-            	iFirst = 0;            	
-            	}
-            iPosOnScreen = iLast - iFirst;
+            if(iItemCount > 0)
+                {
+                iLast = iItemCount - 1;
+                iFirst = iLast - iScreenSize;
+                if ( iFirst < 0 )
+                	{
+                	iFirst = 0;            	
+                	}
+                iPosOnScreen = iLast - iFirst;
+                }
             }
         else if ( iPosOnScreen == 0 )
             {
@@ -4391,15 +4394,22 @@
             {
             case EKeyEnter:
             case EKeyRightArrow:
-                {
+                {           
+                if(iPosOnScreen < iFileList.Count())
+                    {
                 
-                ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() );
-                if (ret == KErrNone)
-                	{
-                	((CTestSetMenu*)iParent)->SetCreated();
-                	((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des());
-                	}
-                return iParent;
+                    ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() );
+                    if (ret == KErrNone)
+                        {
+                        ((CTestSetMenu*)iParent)->SetCreated();
+                        ((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des());
+                        }
+                    return iParent;
+                    }
+                else
+                    {
+                    return this;
+                    }
                 }
             default:
                 break;