ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp
branchRCL_3
changeset 64 3533d4323edc
parent 63 d189ee25cf9d
--- a/ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp	Tue Aug 31 15:04:17 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp	Wed Sep 01 12:28:57 2010 +0100
@@ -225,11 +225,12 @@
     TInt status;
     TInt baseIndex;
     
-    // Messages are sorted always before reading the messages 
-    Sort();
-
-    CMsvEntrySelection* messages = FilterMessagesL();
-    CleanupStack::PushL( messages );
+    if ( !iMessages )
+        {
+        // Messages are sorted before first reading the messages 
+        Sort();
+        iMessages = FilterMessagesL();
+        }
 
     status = SearchL( iMessages, aStartWith, baseIndex );
     
@@ -266,7 +267,7 @@
             {
             fsMsg = iMsgMapper->GetMailMessageL( iMailboxId, entry, 
                 iRequestedDetails );
-            aMessages.AppendL( fsMsg );
+            aMessages.Append( fsMsg );
             counter++;
             }
         i++;
@@ -306,7 +307,7 @@
             {
             fsMsg = iMsgMapper->GetMailMessageL( iMailboxId, entry, 
                 iRequestedDetails );
-            aMessages.InsertL( fsMsg, 0 );
+            aMessages.Insert( fsMsg, 0 );
             counter++;
             }
         i--;