phonebookui/Phonebook2/MapExtension/src/cpmapcontacteditorextension.cpp
branchRCL_3
changeset 45 34879f5cfc63
parent 26 0d28c1c5b6dd
child 64 c1e8ba0c2b16
equal deleted inserted replaced
39:a6539d1e8e43 45:34879f5cfc63
    99 // CPmapContactEditorExtension::~CPmapContactEditorExtension
    99 // CPmapContactEditorExtension::~CPmapContactEditorExtension
   100 // --------------------------------------------------------------------------
   100 // --------------------------------------------------------------------------
   101 //
   101 //
   102 CPmapContactEditorExtension::~CPmapContactEditorExtension()
   102 CPmapContactEditorExtension::~CPmapContactEditorExtension()
   103     {
   103     {
       
   104     if(iCmd)
       
   105         {
       
   106         delete iCmd;
       
   107         iCmd = NULL;
       
   108         }
   104     }
   109     }
   105 
   110 
   106 // --------------------------------------------------------------------------
   111 // --------------------------------------------------------------------------
   107 // CPmapContactEditorExtension::ConstructL
   112 // CPmapContactEditorExtension::ConstructL
   108 // --------------------------------------------------------------------------
   113 // --------------------------------------------------------------------------
   168     {
   173     {
   169     switch( aCommandId )
   174     switch( aCommandId )
   170         {
   175         {
   171         case EPbk2ExtensionShowOnMap:
   176         case EPbk2ExtensionShowOnMap:
   172         	{
   177         	{
   173         	MPbk2Command* cmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
   178         	if(iCmd)
   174         	// Execute the command
   179         	    {
   175         	cmd->ExecuteLD();
   180                 delete iCmd;
       
   181                 iCmd = NULL;
       
   182         	    }
       
   183         	iCmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
       
   184         	// Execute the command 
       
   185         	iCmd->ExecuteLD();
   176             return ETrue;
   186             return ETrue;
   177             }
   187             }
   178         case EPbk2ExtensionAssignFromMap:
   188         case EPbk2ExtensionAssignFromMap:
   179         	{
   189         	{
   180         	MPbk2Command* cmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
   190         	if(iCmd)
       
   191                 {
       
   192                 delete iCmd;
       
   193                 iCmd = NULL;
       
   194                 }
       
   195         	iCmd = CPmapCmd::NewL( iEditorControl, iContact, aCommandId );
   181         	// Execute the command
   196         	// Execute the command
   182         	cmd->ExecuteLD();
   197         	iCmd->ExecuteLD();
   183             return ETrue;
   198             return ETrue;
   184             }
   199             }
   185         default:
   200         default:
   186             {
   201             {
   187             // Do nothing
   202             // Do nothing