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