mpx/commonframework/common/src/mpxuser.cpp
branchRCL_3
changeset 56 63223d4fd956
parent 55 6c1dfe4da5dd
equal deleted inserted replaced
55:6c1dfe4da5dd 56:63223d4fd956
   254 //
   254 //
   255 EXPORT_C void MPXUser::MergeAttributeL(
   255 EXPORT_C void MPXUser::MergeAttributeL(
   256     const TArray<TMPXAttribute>& aSrc,
   256     const TArray<TMPXAttribute>& aSrc,
   257     RArray<TMPXAttribute>& aDest)
   257     RArray<TMPXAttribute>& aDest)
   258     {
   258     {
   259     CleanupClosePushL(aDest);
       
   260     aDest.Reset();
   259     aDest.Reset();
   261     for (TInt i = 0; i < aSrc.Count(); i++)
   260     for (TInt i = 0; i < aSrc.Count(); i++)
   262         {
   261         {
   263         const TMPXAttribute& s = aSrc[i];
   262         const TMPXAttribute& s = aSrc[i];
   264         TInt index = aDest.Find(s, TMPXAttribute::MatchContentId);
   263         TInt index = aDest.Find(s, TMPXAttribute::MatchContentId);
   270             {
   269             {
   271             TMPXAttribute& d = aDest[index];
   270             TMPXAttribute& d = aDest[index];
   272             d = TMPXAttribute(d.ContentId(), d.AttributeId() | s.AttributeId());
   271             d = TMPXAttribute(d.ContentId(), d.AttributeId() | s.AttributeId());
   273             }
   272             }
   274         }
   273         }
   275     CleanupStack::Pop();
       
   276     }
   274     }
   277 
   275 
   278 // ----------------------------------------------------------------------------
   276 // ----------------------------------------------------------------------------
   279 // Determines the owning process id of the thread
   277 // Determines the owning process id of the thread
   280 // ----------------------------------------------------------------------------
   278 // ----------------------------------------------------------------------------
   384 // Internalize an array of item ids from stream
   382 // Internalize an array of item ids from stream
   385 // ----------------------------------------------------------------------------
   383 // ----------------------------------------------------------------------------
   386 //
   384 //
   387 EXPORT_C void MPXUser::InternalizeL(RArray<TMPXItemId>& aArray, RReadStream& aStream)
   385 EXPORT_C void MPXUser::InternalizeL(RArray<TMPXItemId>& aArray, RReadStream& aStream)
   388     {
   386     {
   389     CleanupClosePushL(aArray);
       
   390     TInt n=aStream.ReadInt32L();
   387     TInt n=aStream.ReadInt32L();
   391     for (TInt i=0;i<n;++i)
   388     for (TInt i=0;i<n;++i)
   392         {
   389         {
   393         TUint32 id1(aStream.ReadUint32L());
   390         TUint32 id1(aStream.ReadUint32L());
   394         TUint32 id2(aStream.ReadUint32L());
   391         TUint32 id2(aStream.ReadUint32L());
   395         aArray.AppendL(TMPXItemId(id1,id2));
   392         aArray.AppendL(TMPXItemId(id1,id2));
   396         }
   393         }
   397     CleanupStack::Pop();
       
   398     }
   394     }
   399 
   395 
   400 // ----------------------------------------------------------------------------
   396 // ----------------------------------------------------------------------------
   401 // Externalize an array of itemids to stream
   397 // Externalize an array of itemids to stream
   402 // ----------------------------------------------------------------------------
   398 // ----------------------------------------------------------------------------