clfwrapper/ClientSrc/CCLFItemListModelImpl.cpp
branchRCL_3
changeset 15 3cebc1a84278
parent 14 646a02f170b9
child 22 ab88d4a85041
--- a/clfwrapper/ClientSrc/CCLFItemListModelImpl.cpp	Fri Mar 12 15:44:28 2010 +0200
+++ b/clfwrapper/ClientSrc/CCLFItemListModelImpl.cpp	Mon Mar 15 12:42:24 2010 +0200
@@ -284,7 +284,7 @@
             }
         CDesCArray* array = new (ELeave) CDesCArrayFlat( mimeTypeCount );
         CleanupStack::PushL( array );
-        for( TInt i = 0 ; i < mimeTypeCount ; ++i )
+        for( TInt i = mimeTypeCount - 1; i >=0; i--)
             {
             array->AppendL( aMimeTypes.MdcaPoint( i ) );
             }
@@ -335,7 +335,7 @@
         CArrayFix<TInt>* array =
                         new ( ELeave ) CArrayFixFlat<TInt>( count );
         CleanupStack::PushL( array );
-        for( TInt i = 0 ; i < count ; ++i )
+        for(TInt i = count - 1; i >=0; i--)
             {
             array->AppendL( aMediaTypes[i] );
             }
@@ -363,7 +363,7 @@
         CArrayFix<TInt>* array =
                 new ( ELeave ) CArrayFixFlat<TInt>( numMediaTypes );
         CleanupStack::PushL( array );
-        for( TInt i = 0 ; i < numMediaTypes ; ++i )
+        for( TInt i = numMediaTypes - 1; i >=0; i--)
             {
             array->AppendL( aResource.ReadInt32() );
             }
@@ -443,8 +443,7 @@
 void CCLFItemListModelImpl::CopyArrayL( const TArray<MCLFItem*>& aSource,
                                         RPointerArray<MCLFItem>& aDest )
     {
-    const TInt count( aSource.Count() );
-    for( TInt i = 0 ; i < count ; ++i )
+    for( TInt i = aSource.Count() - 1; i >=0; i--)
         {
         aDest.AppendL( aSource[i] );
         }
@@ -532,7 +531,7 @@
         const TInt count( iItemArray.Count() );
         RArray<TCLFItemId> idArray( count == 0 ? 1 : count );
         CleanupClosePushL( idArray );
-        for( TInt i = 0 ; i < count ; ++i )
+        for( TInt i = count - 1; i >=0; i--)
             {
             idArray.AppendL( iItemArray[i]->ItemId() );
             }