phonebookui/Phonebook2/CommandsExtension/src/CPbk2CopyNumberToClipboardCmd.cpp
branchRCL_3
changeset 6 e8e3147d53eb
parent 0 e686773b3f54
equal deleted inserted replaced
5:81f8547efd4f 6:e8e3147d53eb
   209     }
   209     }
   210     	
   210     	
   211 MVPbkStoreContactField* CPbk2CopyNumberToClipboardCmd::FocusedFieldLC
   211 MVPbkStoreContactField* CPbk2CopyNumberToClipboardCmd::FocusedFieldLC
   212     ( MVPbkStoreContact& aStoreContact )
   212     ( MVPbkStoreContact& aStoreContact )
   213     {
   213     {
   214     TInt index = KErrNotFound;
   214     TInt index = iUiControl->FocusedFieldIndex();
   215     CPbk2PresentationContact* presentationContact = 
       
   216         CPbk2PresentationContact::NewL( aStoreContact,
       
   217             iAppServices->FieldProperties() );
       
   218     CleanupStack::PushL( presentationContact );
       
   219 
       
   220     if (iUiControl)
       
   221         {
       
   222         index = presentationContact->PresentationFields().StoreIndexOfField( 
       
   223                 iUiControl->FocusedFieldIndex() );
       
   224         }
       
   225     CleanupStack::PopAndDestroy( presentationContact );
       
   226     
       
   227     if ( index != KErrNotFound )
   215     if ( index != KErrNotFound )
   228         {
   216         {
   229         // Use FieldAtLC to avoid the unvalidity of the field after new
   217         // Use FieldAtLC to avoid the unvalidity of the field after new
   230         // FieldAt call.        
   218         // FieldAt call.        
   231         return aStoreContact.Fields().FieldAtLC( index );
   219         return aStoreContact.Fields().FieldAtLC( index );