atext/server/src/atextmetadata.cpp
branchRCL_3
changeset 22 786b94c6f0a4
parent 16 9f17f914e828
child 23 5b153be919d4
--- a/atext/server/src/atextmetadata.cpp	Thu Jul 15 19:55:36 2010 +0300
+++ b/atext/server/src/atextmetadata.cpp	Thu Aug 19 11:01:00 2010 +0300
@@ -2049,7 +2049,9 @@
         TRACE_FUNC_EXIT
         return;
         }
-    TATExtEntrySupport entrySupport( aAtCmdFull, aMessage, support );
+    TATExtEntrySupport entrySupport( aAtCmdFull,
+                                     const_cast<RMessage2&>(aMessage),
+                                     support );
     TInt i;
     aComplInfo.iProcessed = EFalse;
     TInt count = support->Count();
@@ -2141,11 +2143,14 @@
     HBufC8* atCmdFull = HBufC8::NewMaxLC( aEntrySupport.iAtCmdFull.Length() );
     TPtr8 atCmdFullPtr = atCmdFull->Des();
     atCmdFullPtr.Copy( aEntrySupport.iAtCmdFull );
+    // First send the entry to the observers
+    TATExtEntrySupport handleCommandEntry = aEntrySupport;
+    aEntrySupport.iStartIndex = aStartIndex;
+    SendToMultipleObserverL( aEntrySupport, atCmdFull );
+    aEntrySupport = handleCommandEntry;
     // Now execute the HandleCommand()
     iCmdData.iReplyExpected = ETrue;  // Set before HandleCommandL()
     HandleCommandL( aEntrySupport, ETrue );
-    aEntrySupport.iStartIndex = aStartIndex;
-    SendToMultipleObserverL( aEntrySupport, atCmdFull );
     CleanupStack::PopAndDestroy( atCmdFull );
     aReplyExpected = ETrue;
     TRACE_FUNC_EXIT
@@ -2187,8 +2192,8 @@
         TPtr8 atCmdFullPtr = atCmdFull->Des();
         atCmdFullPtr.Copy( aEntrySupport.iAtCmdFull );
         // Now execute the HandleCommand()
+        SendToMultipleObserverL( nextSupport, atCmdFull );
         HandleCommandL( aEntrySupport, EFalse );
-        SendToMultipleObserverL( nextSupport, atCmdFull );
         CleanupStack::PopAndDestroy( atCmdFull );
         }
     else
@@ -2727,3 +2732,22 @@
     TRACE_FUNC_EXIT
     return KErrNone;
     }
+
+// ---------------------------------------------------------------------------
+// Assignment operator for ease of usage
+// ---------------------------------------------------------------------------
+//
+TATExtEntrySupport& TATExtEntrySupport::operator=( TATExtEntrySupport& aEntrySupport )
+    {
+    if ( &aEntrySupport == this )
+        {
+        return aEntrySupport;
+        }
+    iAtCmdFull = aEntrySupport.iAtCmdFull;
+    iMessage = aEntrySupport.iMessage;
+    iSupport = aEntrySupport.iSupport;
+    iEntry = aEntrySupport.iEntry;
+    iStartIndex = aEntrySupport.iStartIndex;
+    iSupportFound = aEntrySupport.iSupportFound;
+    return *this;
+    }