mmappcomponents/collectionhelper/src/mpxcollectionhelperimp.cpp
branchRCL_3
changeset 56 63223d4fd956
parent 55 6c1dfe4da5dd
child 67 16db3449d7ba
equal deleted inserted replaced
55:6c1dfe4da5dd 56:63223d4fd956
   547           }
   547           }
   548       }
   548       }
   549 
   549 
   550     CMPXMedia* foundMedia(NULL);
   550     CMPXMedia* foundMedia(NULL);
   551 
   551 
   552     if ( ary && ary->Count() )
   552     switch ( ary && ary->Count() )  //lint !e961
   553         {
   553         {
   554         foundMedia = CMPXMedia::NewL(*ary->AtL(0));
   554         case 0:
   555         CleanupStack::PushL(foundMedia);
   555             User::Leave(KErrNotFound);
   556         foundMedia->SetTObjectValueL<TUid>( KMPXMediaGeneralCollectionId, TUid::Uid(col) );
   556         case 1:
   557         CleanupStack::Pop(foundMedia);
   557             {
   558         }
   558             foundMedia = CMPXMedia::NewL(*ary->AtL(0));
   559     else
   559             CleanupStack::PushL(foundMedia);
   560         {
   560             foundMedia->SetTObjectValueL<TUid>(
   561         User::Leave(KErrNotFound);    
   561                 KMPXMediaGeneralCollectionId, TUid::Uid(col) );
   562         }
   562             CleanupStack::Pop(foundMedia);
   563     
   563             break;
       
   564             }
       
   565         default:
       
   566             User::Leave(KErrCorrupt);
       
   567         }
       
   568 
   564     CleanupStack::PopAndDestroy(result);
   569     CleanupStack::PopAndDestroy(result);
       
   570 
   565     return foundMedia;
   571     return foundMedia;
   566     }
   572     }
   567 
   573 
   568 // ---------------------------------------------------------------------------
   574 // ---------------------------------------------------------------------------
   569 // Gets the attributes of some media object
   575 // Gets the attributes of some media object