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