phoneuis/easydialing/src/easydialinglistbox.cpp
branchRCL_3
changeset 44 3c221667e687
parent 39 b8d67d6176f5
child 58 40a3f856b14d
--- a/phoneuis/easydialing/src/easydialinglistbox.cpp	Wed Jun 09 09:41:11 2010 +0300
+++ b/phoneuis/easydialing/src/easydialinglistbox.cpp	Mon Jun 21 15:39:45 2010 +0300
@@ -491,14 +491,23 @@
 
 
 // -----------------------------------------------------------------------------
-// CurrentContactLinkLC
+// CurrentContactLinkL
 // 
 // -----------------------------------------------------------------------------
 //
-HBufC8* CEasyDialingListBox::CurrentContactLinkLC()
+HBufC8* CEasyDialingListBox::CurrentContactLinkL()
     {
     TInt index = CurrentContactDataIndex();
-    return iContactDataManager->ContactLinkLC( index );
+    if ( index >= 0 )
+        {
+        HBufC8* packedContact = iContactDataManager->ContactLinkLC( index );
+        CleanupStack::Pop( packedContact );
+        return packedContact;
+        }
+    else
+        {
+        return NULL;
+        }
     }
 
 
@@ -533,7 +542,18 @@
         iPointerLongPressHandled = EFalse;
         }
     
-    iLongTapDetector->PointerEventL(aPointerEvent);
+    // check if pointer event is over item
+    TInt itemIndex( KErrNotFound );
+    TPoint pointerPos( aPointerEvent.iPosition );
+    TBool pointerIsOverAnItem = iView->XYPosToItemIndex( pointerPos, itemIndex );
+    
+    // long tap is started only if pointer is over an actual item
+    // (not over margin or other empty listbox area)
+    if ( pointerIsOverAnItem || aPointerEvent.iType != TPointerEvent::EButton1Down )
+        {
+        iLongTapDetector->PointerEventL(aPointerEvent);
+        }
+    
     if ( iPointerLongPressHandled )
         {
         // No further handling is made after long tap on list item