usbuis/usbui/USBClassChangeUIPlugin/src/USBClassChangeUIPluginContainer.cpp
changeset 2 468cfcb53fd1
parent 0 1e05558e2206
child 24 1a297fa72b1e
--- a/usbuis/usbui/USBClassChangeUIPlugin/src/USBClassChangeUIPluginContainer.cpp	Thu Jan 07 13:25:34 2010 +0200
+++ b/usbuis/usbui/USBClassChangeUIPlugin/src/USBClassChangeUIPluginContainer.cpp	Mon Jan 18 21:13:23 2010 +0200
@@ -269,14 +269,17 @@
 void CUSBClassChangeUIPluginContainer::ShowPopUpsL(TInt aIndex)
     {
     FLOG(_L("[CUSBClassChangeUIPlugin]\t CUSBClassChangeUIPluginContainer::ShowPopUpsL "));
-    iPopupController->SetTimePopupInView( KMaxVisibleTime);
-    TPtrC chosen = iPopUpItems->MdcaPoint(aIndex);
-    iPopupController->SetTextL( chosen );
-    iPopupController->SetPositionByHighlight( TRect( 
+    if ( aIndex >= 0 && aIndex < iPopUpItems->Count() )
+        {
+        iPopupController->SetTimePopupInView( KMaxVisibleTime);
+        TPtrC chosen = iPopUpItems->MdcaPoint(aIndex);
+        iPopupController->SetTextL( chosen );
+        iPopupController->SetPositionByHighlight( TRect( 
                    iUSBMainListBox->View()->ItemPos( aIndex + 1 ), 
                    iUSBMainListBox->View()->ItemSize() ) );
-    iPopupController->SetTimeDelayBeforeShow( KMsToWaitBeforePopup );
-    iPopupController->ShowInfoPopupNote();
+        iPopupController->SetTimeDelayBeforeShow( KMsToWaitBeforePopup );
+        iPopupController->ShowInfoPopupNote();
+        }
     FLOG(_L("[CUSBClassChangeUIPlugin]\t CUSBClassChangeUIPluginContainer::ShowPopUpsL complete"));
   
 }