changeset 172:44d6af34c75a

mmiSmsMenu.c: formatting fixes and dead code elimination
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 18 Jan 2021 02:33:57 +0000
parents 4ef7466a72c9
children 0a0d54877239
files src/ui/bmi/mmiSmsMenu.c
diffstat 1 files changed, 288 insertions(+), 533 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui/bmi/mmiSmsMenu.c	Mon Jan 18 01:33:09 2021 +0000
+++ b/src/ui/bmi/mmiSmsMenu.c	Mon Jan 18 02:33:57 2021 +0000
@@ -12,11 +12,11 @@
  $Project name: Basic MMI
  $Project code: BMI
  $Module:   SMS
- $File:       MmiSmsMenu.c
- $Revision:   1.0
+ $File:     MmiSmsMenu.c
+ $Revision: 1.0
 
  $Author:   Condat(UK)
- $Date:       25/10/00
+ $Date:     25/10/00
 
 ********************************************************************************
 
@@ -204,7 +204,6 @@
 } T_MFW_MAILBOX_ID;
 
 
-
 typedef enum
 {
   SMS_DELETING,
@@ -229,7 +228,7 @@
 
     /* internal data */
 
-  T_SmsUserData * user_data; // text and phone number of the message
+    T_SmsUserData * user_data; // text and phone number of the message
 } T_M_SND_SAV;
 
 typedef struct
@@ -240,21 +239,21 @@
     T_MFW_HND       win;
     SHORT           id;
     T_MFW_HND       parent;
-  T_MFW_HND       waiting_win;
+    T_MFW_HND       waiting_win;
 
     /* associated handlers */
-  T_MFW_HND       sms_hnd;         /* MFW sms handler      */
+    T_MFW_HND       sms_hnd;         /* MFW sms handler      */
 
     /* internal data */
 
-  MySmsType  type; // The type of the SMS to delete (SMS or SMS-CB)
-  //May 27, 2005    MMI-FIX-29869 x0018858
+    MySmsType  type; // The type of the SMS to delete (SMS or SMS-CB)
+    //May 27, 2005    MMI-FIX-29869 x0018858
 #ifdef FF_MMI_SMS_DYNAMIC
-  T_MFW_SMS_MSG *g_SmsMenu_messages;
+    T_MFW_SMS_MSG *g_SmsMenu_messages;
 #else
-  T_MFW_SMS_MSG g_SmsMenu_messages[MAX_MESSAGES];
+    T_MFW_SMS_MSG g_SmsMenu_messages[MAX_MESSAGES];
 #endif
-  T_MFW_HND   child_dialog;
+    T_MFW_HND   child_dialog;
 } T_M_DEL_ALL;
 
 typedef struct
@@ -271,12 +270,9 @@
     T_MFW_HND       kbd;
     T_MFW_HND       kbd_long;
     T_MFW_HND       menu;
-
-
 } T_V;
 
 
-
 typedef struct
 {
     /* administrative data */
@@ -288,10 +284,8 @@
 
     /* associated handlers */
 
-
     /* internal data */
     UBYTE voice_number_buffer[NUMBER_LENGTH];
-
 } T_V_NUM;
 
 static T_MFW_HND M_SND_SAV_create (T_MFW_HND parent);
@@ -350,38 +344,36 @@
 
     /* Copy the number and name information to the SMS buffer
     */
-	/*MC SPR 1257, clear whole buffer in case of Unicode entry*/
+    /*MC SPR 1257, clear whole buffer in case of Unicode entry*/
 
     /*SPR 2587, check that SMS has been initialised*/
-	if (!smsidle_get_ready_state() || phb_get_mode() == PHB_LOADING)
-	{
-
-		mmi_dialog_information_screen(0, TxtPleaseWait, NULL, NULL, NULL);
-		return 0;
-	}
-	//	Jul 13, 2004    REF: CRR 21615  Deepa M.D
-	//  Copy the content from the temporary buffer into the editor,so that the
-	//  previously typed content is retained.
+    if (!smsidle_get_ready_state() || phb_get_mode() == PHB_LOADING)
+    {
+	mmi_dialog_information_screen(0, TxtPleaseWait, NULL, NULL, NULL);
+	return 0;
+    }
+    //	Jul 13, 2004    REF: CRR 21615  Deepa M.D
+    //  Copy the content from the temporary buffer into the editor,so that the
+    //  previously typed content is retained.
 #ifdef TI_PS_FF_CONC_SMS
     if(FFS_flashData.ConcatenateStatus == TRUE)
-   	{
-		memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN);
-		memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN);
-   	}
-
+    {
+	memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN);
+	memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN);
+    }
     else
 #endif /*TI_PS_FF_CONC_SMS*/
-	{
-		memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN_SGL);
-		//Copy only 160 characters ofthe message.
-		memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN_SGL-1);
-	}
+    {
+	memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN_SGL);
+	//Copy only 160 characters ofthe message.
+	memcpy(SmsData.TextBuffer, TempTextBuffer,MAX_MSG_LEN_SGL-1);
+    }
 
     SmsData.NumberBuffer[0]='\0'; //set the number to null.
     SmsData.called_from_reply_item = FALSE;
 
-	SmsSend_SEND_start(win, (void *) &SmsData);
-	return 1;
+    SmsSend_SEND_start(win, (void *) &SmsData);
+    return 1;
 }
 
 /*******************************************************************************
@@ -401,12 +393,12 @@
 int M_exeRead(MfwMnu* m, MfwMnuItem* i)
 {
     T_MFW_HND       win  = mfwParent(mfw_header());
-  T_MFW_SMS_STAT  sms_list_type = MFW_SMS_ALL;
+    T_MFW_SMS_STAT  sms_list_type = MFW_SMS_ALL;
 
-  /* Call the function that manages SMS reading */
-  SmsRead_R_start(win, (MfwMnuAttr*)&sms_list_type);
+    /* Call the function that manages SMS reading */
+    SmsRead_R_start(win, (MfwMnuAttr*)&sms_list_type);
 
-  return 1;
+    return 1;
 }
 
 /*******************************************************************************
@@ -426,13 +418,13 @@
 int M_exeDelAll(MfwMnu* m, MfwMnuItem* i)
 {
     T_MFW_HND       win  = mfwParent(mfw_header());
-  MySmsType sms_type;
+    MySmsType sms_type;
 
-  sms_type = SMS_TYPE;
-  // Here we have to pass the type of sms to delete (SMS or SMS-CB)
-  M_DEL_ALL_start(win, (void *)&sms_type);
+    sms_type = SMS_TYPE;
+    // Here we have to pass the type of sms to delete (SMS or SMS-CB)
+    M_DEL_ALL_start(win, (void *)&sms_type);
 
-  return 1;
+    return 1;
 }
 
 /*******************************************************************************
@@ -453,43 +445,35 @@
 {
     T_MFW_HND       win  = mfwParent(mfw_header());
 
-  M_SND_SAV_start(win, 0);
+    M_SND_SAV_start(win, 0);
 
-  return 1;
+    return 1;
 }
 
 
-
 /*******************************************************************************
 
  $Function:     voice_mail_init
 
  $Description:  initialization the voice mail buffer
 
-
  $Returns:
 
  $Arguments:
 
-
 *******************************************************************************/
 
 int voice_mail_init (void)
 {
-
   //nm, later have to read the voice mail number from FFS after switching-on the mobile
 
   //to clear the buffer is only temporary until we are able to save on Flash
   //memset(voice_mail, '\0', sizeof(voice_mail));
 
-
-
   return 1;
 }
 
 
-
-
 /*******************************************************************************
 
  $Function:     M_exeVoice
@@ -515,10 +499,10 @@
     win = V_create (parent_window);
 
     if (win NEQ NULL)
-  {
-      SEND_EVENT (win, E_INIT, V_ID_SET, 0);
-  }
-  return 1;
+    {
+	SEND_EVENT (win, E_INIT, V_ID_SET, 0);
+    }
+    return 1;
 }
 
 
@@ -541,43 +525,18 @@
     T_MFW_HND       win;
     T_MFW_HND       parent_win  = mfwParent(mfw_header());
 
-
     TRACE_FUNCTION ("M_callVoice()");
 
     win = V_create (parent_win);
 
     if (win NEQ NULL)
-  {
-      SEND_EVENT (win, E_INIT, V_ID_CALL, 0);
-  }
-
-  return 1;
-}
-
-
-/*SPR 1920 removed obsolete function*/
-
-#if(0) /* x0039928 - Lint warning removal */
-/*******************************************************************************
-
- $Function:     ExeSms_sendM_SND_SAV
-
- $Description:  Called when the user press Saved SMS from the Send SMS menu
-
- $Returns:    Execution status
-
- $Arguments:  m - menu handler
-        i - Menu item selected
-
-*******************************************************************************/
-
-static int ExeSms_sendM_SND_SAV(MfwMnu* m, MfwMnuItem* i)
-{
-    T_MFW_HND       win  = mfwParent(mfw_header());
+    {
+	SEND_EVENT (win, E_INIT, V_ID_CALL, 0);
+    }
 
     return 1;
 }
-#endif
+
 
 /*******************************************************************************
 
@@ -601,9 +560,9 @@
     win = M_SND_SAV_create (parent_window);
 
     if (win NEQ NULL)
-  {
-      SEND_EVENT (win, E_INIT, M_SND_SAV_ID, (void *)menuAttr);
-  }
+    {
+	SEND_EVENT (win, E_INIT, M_SND_SAV_ID, (void *)menuAttr);
+    }
     return win;
 }
 
@@ -626,22 +585,21 @@
 
     TRACE_FUNCTION ("M_SND_SAV_create()");
 
-
     /*
      * Create window handler
      */
 
     data->win =
-  win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_SND_SAV_win_cb);
+      win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_SND_SAV_win_cb);
 
     if (data->win EQ NULL)
-  {
-      return NULL;
-  }
+    {
+	return NULL;
+    }
+
     /*
      * connect the dialog data to the MFW-window
      */
-
     data->mmi_control.dialog = (T_DIALOG_FUNC)M_SND_SAV_exec_cb;
     data->mmi_control.data   = data;
     win                      = ((T_MFW_HDR *)data->win)->data;
@@ -675,28 +633,28 @@
     TRACE_FUNCTION ("M_SND_SAV_destroy()");
 
     if (own_window)
-  {
-      win_data = ((T_MFW_HDR *)own_window)->data;
-      data = (T_M_SND_SAV *)win_data->user;
+    {
+	win_data = ((T_MFW_HDR *)own_window)->data;
+	data = (T_M_SND_SAV *)win_data->user;
 
-      if (data)
-    {
-        /*
-         * Delete WIN handler
-         */
-        win_delete (data->win);
+	if (data)
+	{
+	    /*
+	     * Delete WIN handler
+	     */
+	    win_delete (data->win);
 
-        /*
-         * Free Memory
-         */
-        FREE_MEMORY ((void *)data->user_data, sizeof (T_SmsUserData));
-      FREE_MEMORY ((void *)data, sizeof (T_M_SND_SAV));
+	    /*
+	     * Free Memory
+	     */
+	    FREE_MEMORY ((void *)data->user_data, sizeof (T_SmsUserData));
+	    FREE_MEMORY ((void *)data, sizeof (T_M_SND_SAV));
+	}
+	else
+	{
+	    TRACE_EVENT ("M_SND_SAV_destroy() called twice");
+	}
     }
-      else
-    {
-        TRACE_EVENT ("M_SND_SAV_destroy() called twice");
-    }
-  }
 }
 
 /*******************************************************************************
@@ -725,80 +683,45 @@
     TRACE_FUNCTION ("M_SND_SAV_exec_cb()");
 
     switch (event)
-  {
-  case E_INIT:
-      /* initialization of administrative data */
-      data->id = value;
-    data->user_data = (T_SmsUserData *)ALLOC_MEMORY (sizeof (T_SmsUserData));
-    /*MC SPR 1257, clear whole buffer in case of Unicode entry*/
+    {
+    case E_INIT:
+	/* initialization of administrative data */
+	data->id = value;
+	data->user_data = (T_SmsUserData *)ALLOC_MEMORY (sizeof (T_SmsUserData));
+	/*MC SPR 1257, clear whole buffer in case of Unicode entry*/
 #ifdef TI_PS_FF_CONC_SMS
- 	if(FFS_flashData.ConcatenateStatus == TRUE)
- 		memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN_SGL);
-    else
+	if(FFS_flashData.ConcatenateStatus == TRUE)
+		memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN_SGL);
+	else
 #endif /*TI_PS_FF_CONC_SMS*/
-    	memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN);
-    data->user_data->NumberBuffer[0] = '\0';
+	    memset( data->user_data->TextBuffer, '\0', MAX_MSG_LEN);
+	data->user_data->NumberBuffer[0] = '\0';
 
-      /* initialization of the dialog data */
+	/* initialization of the dialog data */
 
-      /* create the dialog handler */
-      data->kbd =      kbdCreate(data->win,KEY_ALL,         (MfwCb)M_SND_SAV_kbd_cb);
-      data->kbd_long = kbdCreate(data->win,KEY_ALL|KEY_LONG,(MfwCb)M_SND_SAV_kbd_cb);
+	/* create the dialog handler */
+	data->kbd =      kbdCreate(data->win,KEY_ALL,         (MfwCb)M_SND_SAV_kbd_cb);
+	data->kbd_long = kbdCreate(data->win,KEY_ALL|KEY_LONG,(MfwCb)M_SND_SAV_kbd_cb);
+
+	/* put the (new) dialog window on top of the window stack */
+	mnuUnhide(data->menu);
+	winShow(win);
+	break;
 
-      /* put the (new) dialog window on top of the window stack */
-      mnuUnhide(data->menu);
-        winShow(win);
-      break;
-  case E_ABORT:
-  case E_EXIT:
-      l_parent = data->parent;
-      l_id = data->id;
-      M_SND_SAV_destroy(data->win);
-      SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */
-      break;
+    case E_ABORT:
+    case E_EXIT:
+	l_parent = data->parent;
+	l_id = data->id;
+	M_SND_SAV_destroy(data->win);
+	SEND_EVENT (l_parent, event, l_id, NULL); /* forward event to parent */
+	break;
 
-  case E_RETURN:
-  default:
-      return;
-  }
+    case E_RETURN:
+    default:
+	return;
+    }
 }
 
-#if(0) /* x0039928 - Lint warning fix */
-/*******************************************************************************
-
- $Function:     M_SND_SAV_mnu_cb
-
- $Description:  Menu callback for the saved SMS menu window
-
- $Returns:    Execution status
-
- $Arguments:  e - event id
-        m - menu handle
-
-*******************************************************************************/
-
-static int M_SND_SAV_mnu_cb (MfwEvt e, MfwMnu *m)
-    /* M_SND_SAV menu event handler */
-{
-    T_MFW_HND    win  = mfwParent(mfw_header());
-    T_MFW_WIN  * win_data = ((T_MFW_HDR *)win)->data;
-    T_M_SND_SAV      * data = (T_M_SND_SAV *)win_data->user;
-
-    TRACE_FUNCTION ("M_SND_SAV_mnu_cb()");
-
-    switch (e)
-        {
-  case E_MNU_ESCAPE: /* back to previous menu */
-      M_SND_SAV_destroy(data->win);
-      SEND_EVENT (data->parent, E_RETURN, data->id, NULL);
-      break;
-  default: /* in mnuCreate() only E_MNU_ESCAPE has been enabled! */
-      return MFW_EVENT_REJECTED;
-        }
-    return MFW_EVENT_CONSUMED;
-}
-#endif
-
 /*******************************************************************************
 
  $Function:     M_SND_SAV_win_cb
@@ -818,15 +741,15 @@
     TRACE_FUNCTION ("M_SND_SAV_win_cb()");
 
     switch (e)
-  {
-        case MfwWinVisible:  /* window is visible  */
-      displaySoftKeys(TxtSoftSelect,TxtSoftBack);
-      break;
-  case MfwWinFocussed: /* input focus / selected   */
-  case MfwWinDelete:   /* window will be deleted   */
-        default:
-      return MFW_EVENT_REJECTED;
-  }
+    {
+    case MfwWinVisible:  /* window is visible  */
+	displaySoftKeys(TxtSoftSelect,TxtSoftBack);
+	break;
+    case MfwWinFocussed: /* input focus / selected   */
+    case MfwWinDelete:   /* window will be deleted   */
+    default:
+	return MFW_EVENT_REJECTED;
+    }
     return MFW_EVENT_CONSUMED;
 }
 
@@ -853,41 +776,41 @@
     TRACE_FUNCTION ("M_SND_SAV_kbd_cb()");
 
     if (e & KEY_LONG)
-  {
-      switch (k->code)
     {
-    case KCD_HUP: /* back to previous menu */
-        mnuEscape(data->menu);
-        break;
-    case KCD_RIGHT: /* Power Down */
-        return MFW_EVENT_REJECTED; /* handled by idle */
-    default: /* no response to all other keys */
-        return MFW_EVENT_CONSUMED;
+	switch (k->code)
+	{
+	case KCD_HUP: /* back to previous menu */
+		mnuEscape(data->menu);
+		break;
+	case KCD_RIGHT: /* Power Down */
+		return MFW_EVENT_REJECTED; /* handled by idle */
+	default: /* no response to all other keys */
+		return MFW_EVENT_CONSUMED;
+	}
     }
-  }
     else
-  {
-      switch (k->code)
     {
-    case KCD_MNUUP: /* highlight previous entry */
-        mnuUp(data->menu);
-        winShow(win);
-        break;
-    case KCD_MNUDOWN: /* highlight next entry */
-        mnuDown(data->menu);
-        winShow(win);
-        break;
-    case KCD_LEFT: /* activate this entry */
-        mnuSelect(data->menu);
-        break;
-    case KCD_HUP: /* back to previous menu */
-    case KCD_RIGHT: /* back to previous menu */
-        mnuEscape(data->menu);
-        break;
-    default: /* no response to all other keys */
-        return MFW_EVENT_CONSUMED;
+	switch (k->code)
+	{
+	case KCD_MNUUP: /* highlight previous entry */
+		mnuUp(data->menu);
+		winShow(win);
+		break;
+	case KCD_MNUDOWN: /* highlight next entry */
+		mnuDown(data->menu);
+		winShow(win);
+		break;
+	case KCD_LEFT: /* activate this entry */
+		mnuSelect(data->menu);
+		break;
+	case KCD_HUP: /* back to previous menu */
+	case KCD_RIGHT: /* back to previous menu */
+		mnuEscape(data->menu);
+		break;
+	default: /* no response to all other keys */
+		return MFW_EVENT_CONSUMED;
+	}
     }
-  }
     return MFW_EVENT_CONSUMED;
 }
 
@@ -914,9 +837,9 @@
     win = M_DEL_ALL_create (parent_window);
 
     if (win NEQ NULL)
-  {
-      SEND_EVENT (win, E_INIT, M_DEL_ALL_ID, (void *)menuAttr);
-  }
+    {
+	SEND_EVENT (win, E_INIT, M_DEL_ALL_ID, (void *)menuAttr);
+    }
     return win;
 }
 
@@ -944,16 +867,16 @@
      */
 
     data->win =
-  win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_DEL_ALL_win_cb);
+      win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)M_DEL_ALL_win_cb);
 
     if (data->win EQ NULL)
-  {
-      return NULL;
-  }
+    {
+	return NULL;
+    }
+
     /*
      * connect the dialog data to the MFW-window
      */
-
     data->mmi_control.dialog = (T_DIALOG_FUNC)M_DEL_ALL_exec_cb;
     data->mmi_control.data   = data;
     win                      = ((T_MFW_HDR *)data->win)->data;
@@ -987,34 +910,34 @@
     TRACE_FUNCTION ("M_DEL_ALL_destroy()");
 
     if (own_window)
-  {
-      win_data = ((T_MFW_HDR *)own_window)->data;
-      data = (T_M_DEL_ALL *)win_data->user;
+    {
+	win_data = ((T_MFW_HDR *)own_window)->data;
+	data = (T_M_DEL_ALL *)win_data->user;
 
-      if (data)
-    {
-        /*
-         * Delete WIN handler
-         */
+	if (data)
+	{
+	    /*
+	     * Delete WIN handler
+	     */
 
-      if  (data->waiting_win)
-      {
-               SEND_EVENT(data->waiting_win,DIALOG_DESTROY,0,0 );
-        data->waiting_win = 0;
-      }
+	    if  (data->waiting_win)
+	    {
+		SEND_EVENT(data->waiting_win,DIALOG_DESTROY,0,0 );
+		data->waiting_win = 0;
+	    }
 
-        win_delete (data->win);
+	    win_delete (data->win);
 
-        /*
-         * Free Memory
-         */
-        FREE_MEMORY ((void *)data, sizeof (T_M_DEL_ALL));
+	    /*
+	     * Free Memory
+	     */
+	    FREE_MEMORY ((void *)data, sizeof (T_M_DEL_ALL));
+	}
+	else
+	{
+	    TRACE_EVENT ("M_DEL_ALL_destroy() called twice");
+	}
     }
-      else
-    {
-        TRACE_EVENT ("M_DEL_ALL_destroy() called twice");
-    }
-  }
 }
 
 /*******************************************************************************
@@ -1037,71 +960,72 @@
 {
     T_MFW_WIN      * win_data = ((T_MFW_HDR *) win)->data;
     T_M_DEL_ALL    * data = (T_M_DEL_ALL *)win_data->user;
-  T_MFW_EVENT      MfwEvents;
+    T_MFW_EVENT      MfwEvents;
 
     T_DISPLAY_DATA  DisplayInfo;
 
     TRACE_FUNCTION ("M_DEL_ALL_exec_cb()");
 
     switch (event)
-  {
-  case E_INIT:
-      /* initialization of administrative data */
-      data->id = value;
+    {
+    case E_INIT:
+	/* initialization of administrative data */
+	data->id = value;
 
-      /* initialization of the dialog data */
-    data->type = (MySmsType)(int)parameter;  /* x0039928 - Lint warning fix */
+	/* initialization of the dialog data */
+	data->type = (MySmsType)(int)parameter;  /* x0039928 - Lint warning fix */
 
 	/*SPR2139, initialise sms handle to NULL*/
-   data->sms_hnd = NULL;
+	data->sms_hnd = NULL;
 
-    /* create the dialog handler */
-    // Display the dialog window to delete all the SMS
-    SmsMenu_loadDialogDefault(&DisplayInfo);
+	/* create the dialog handler */
+	// Display the dialog window to delete all the SMS
+	SmsMenu_loadDialogDefault(&DisplayInfo);
 
-    //NM 29.8 Check before deleting, is SIM ready ?!  */
-    if (!smsidle_get_ready_state())
-    {
-      DisplayInfo.TextId     = TxtWaiting;
-      DisplayInfo.Identifier = SMSMENU_ID_NOTREADY;
-      }
-    else
-    {	/*SPR 2139, if there are no SMSs on the SIM*/
-		if ( sms_message_count(MFW_SMS_ALL) == 0)
-		{	/*tell user*/
-			DisplayInfo.TextId     = TxtEmptyList;
+	//NM 29.8 Check before deleting, is SIM ready ?!  */
+	if (!smsidle_get_ready_state())
+	{
+	    DisplayInfo.TextId     = TxtWaiting;
+	    DisplayInfo.Identifier = SMSMENU_ID_NOTREADY;
+	}
+	else
+	{
+	    /*SPR 2139, if there are no SMSs on the SIM*/
+	    if ( sms_message_count(MFW_SMS_ALL) == 0)
+	    {	/*tell user*/
+		DisplayInfo.TextId     = TxtEmptyList;
       		DisplayInfo.Identifier = SMSMENU_ID_NOMESSAGES;
-		}
-		else
-		{ 	/*SPR 2139, only create an SMS event handler if sms initialised and sms list is not empty*/
-			MfwEvents = E_SMS_MO_AVAIL | E_SMS_ERR | E_SMS_OK;
+	    }
+	    else
+	    { 	/*SPR 2139, only create an SMS event handler if sms initialised and sms list is not empty*/
+		MfwEvents = E_SMS_MO_AVAIL | E_SMS_ERR | E_SMS_OK;
     		data->sms_hnd = sms_create(data->win,MfwEvents,(MfwCb)M_DEL_ALL_mfw_cb);
 
      	 	DisplayInfo.TextId       = TxtOkToDelete;
       		DisplayInfo.Time         = FIVE_SECS;
       		DisplayInfo.KeyEvents    = KEY_RIGHT|KEY_LEFT|KEY_CLEAR;
-     		 DisplayInfo.Identifier   = SMSMENU_ID_DELETEALL;
+     		DisplayInfo.Identifier   = SMSMENU_ID_DELETEALL;
       		DisplayInfo.LeftSoftKey  = TxtSoftOK;
       		DisplayInfo.RightSoftKey = TxtSoftBack;
-		}
-    }
-    // Generic function for info messages
+	    }
+	}
+	// Generic function for info messages
 
         (void) info_dialog(win, &DisplayInfo);
 
-    winShow(win);
+	winShow(win);
 
-    break;
+	break;
 
-  case E_ABORT:
-  case E_EXIT:
-      M_DEL_ALL_destroy (data->win);
-      break;
+    case E_ABORT:
+    case E_EXIT:
+	M_DEL_ALL_destroy (data->win);
+	break;
 
-  case E_RETURN:
-  default:
-      return;
-  }
+    case E_RETURN:
+    default:
+	return;
+    }
 }
 
 /*******************************************************************************
@@ -1123,15 +1047,15 @@
     TRACE_FUNCTION ("M_DEL_ALL_win_cb()");
 
     switch (e)
-  {
-        case MfwWinVisible:  /* window is visible  */
-      displaySoftKeys(TxtSoftSelect,TxtSoftBack);
-      break;
-  case MfwWinFocussed: /* input focus / selected   */
-  case MfwWinDelete:   /* window will be deleted   */
-        default:
-      return MFW_EVENT_REJECTED;
-  }
+    {
+    case MfwWinVisible:  /* window is visible  */
+	displaySoftKeys(TxtSoftSelect,TxtSoftBack);
+	break;
+    case MfwWinFocussed: /* input focus / selected   */
+    case MfwWinDelete:   /* window will be deleted   */
+    default:
+	return MFW_EVENT_REJECTED;
+    }
     return MFW_EVENT_CONSUMED;
 }
 
@@ -1141,7 +1065,6 @@
 
  $Description:  Exec callback function for the DEL_ALL window
 
-
  $Returns:    none
 
  $Arguments:  event - event id
@@ -1157,27 +1080,26 @@
 
   // T_MFW_EVENT       MfwEvents;  // RAVI
 
-
-  T_DISPLAY_DATA DisplayInfo;
+    T_DISPLAY_DATA DisplayInfo;
 
     TRACE_FUNCTION ("M_DEL_ALL_ACK_mfw_cb()");
 
     switch (event)
-  {
+    {
 
-  case E_SMS_ERR:
+    case E_SMS_ERR:
 
-    g_SmsMenu_state = SMS_READY;
+	g_SmsMenu_state = SMS_READY;
 
-    SmsMenu_loadDialogDefault(&DisplayInfo);
-    DisplayInfo.Identifier = SMSMENU_ID_DELERR;
-    DisplayInfo.TextId     = TxtFailed;
-    info_dialog(win,&DisplayInfo);
-    break;
+	SmsMenu_loadDialogDefault(&DisplayInfo);
+	DisplayInfo.Identifier = SMSMENU_ID_DELERR;
+	DisplayInfo.TextId     = TxtFailed;
+	info_dialog(win,&DisplayInfo);
+	break;
 
-  case E_SMS_OK:
+    case E_SMS_OK:
 
-   TRACE_EVENT("Event: E_SMS_OK");
+	TRACE_EVENT("Event: E_SMS_OK");
 
     //        March 31, 2005    REF: CRR MMI-SPR-24511   x0012852
     //  	 Check added for part message before deleting all messages.
@@ -1230,7 +1152,6 @@
 
  $Description:  Start the voice mailbox dialog window.
 
-
  $Returns:    window handle
 
  $Arguments:  parent_window - parent window handle
@@ -1247,9 +1168,9 @@
     win = V_create (parent_window);
 
     if (win NEQ NULL)
-  {
-      SEND_EVENT (win, E_INIT, V_ID_SET, (void *)menuAttr);
-  }
+    {
+	SEND_EVENT (win, E_INIT, V_ID_SET, (void *)menuAttr);
+    }
     return win;
 }
 
@@ -1277,15 +1198,15 @@
      */
 
     data->win =
-  win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)V_win_cb);
+      win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)V_win_cb);
     if (data->win EQ NULL)
-  {
-      return NULL;
-  }
+    {
+	return NULL;
+    }
+
     /*
      * connect the dialog data to the MFW-window
      */
-
     data->mmi_control.dialog = (T_DIALOG_FUNC)V_exec_cb;
     data->mmi_control.data   = data;
     win                      = ((T_MFW_HDR *)data->win)->data;
@@ -1319,27 +1240,27 @@
     TRACE_FUNCTION ("V_destroy()");
 
     if (own_window)
-  {
-      win_data = ((T_MFW_HDR *)own_window)->data;
-      data = (T_V *)win_data->user;
+    {
+	win_data = ((T_MFW_HDR *)own_window)->data;
+	data = (T_V *)win_data->user;
 
-      if (data)
-    {
-        /*
-         * Delete WIN handler
-         */
-        win_delete (data->win);
+	if (data)
+	{
+	    /*
+	     * Delete WIN handler
+	     */
+	    win_delete (data->win);
 
-        /*
-         * Free Memory
-         */
-        FREE_MEMORY ((void *)data, sizeof (T_V));
+	    /*
+	     * Free Memory
+	     */
+	    FREE_MEMORY ((void *)data, sizeof (T_V));
+	}
+	else
+	{
+	    TRACE_FUNCTION ("V_destroy() called twice");
+	}
     }
-      else
-    {
-        TRACE_FUNCTION ("V_destroy() called twice");
-    }
-  }
 }
 
 /*******************************************************************************
@@ -1366,7 +1287,7 @@
  // char mail_alpha[10+1] = ""; // size hard coded in pcm.h   // RAVI
 
 #ifdef NEW_EDITOR
-	T_AUI_EDITOR_DATA editor_data;	/* SPR#1428 - SH - New Editor data */
+    T_AUI_EDITOR_DATA editor_data;	/* SPR#1428 - SH - New Editor data */
 #else
     T_EDITOR_DATA editor_data;
 #endif
@@ -1434,12 +1355,10 @@
         }
       }
 
-
       break;
 
     case E_ABORT:
         V_destroy(win);
-
         break;
 
     case E_RETURN:
@@ -1469,20 +1388,19 @@
     TRACE_FUNCTION ("V_win_cb()");
 
     switch (e)
-  {
-        case MfwWinVisible:  /* window is visible  */
-      displaySoftKeys(TxtSoftSelect,TxtSoftBack);
-      break;
-  case MfwWinFocussed: /* input focus / selected   */
-  case MfwWinDelete:   /* window will be deleted   */
-        default:
-      return MFW_EVENT_REJECTED;
-  }
+    {
+    case MfwWinVisible:  /* window is visible  */
+	displaySoftKeys(TxtSoftSelect,TxtSoftBack);
+	break;
+    case MfwWinFocussed: /* input focus / selected   */
+    case MfwWinDelete:   /* window will be deleted   */
+    default:
+	return MFW_EVENT_REJECTED;
+    }
     return MFW_EVENT_CONSUMED;
 }
 
 
-
 /*******************************************************************************
 
  $Function:     SmsMenu_standard_dialog_cb
@@ -1499,12 +1417,11 @@
 
 int SmsMenu_standard_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason)
 {
-  T_MFW_WIN      * win_data = ((T_MFW_HDR *) win)->data;
+    T_MFW_WIN      * win_data = ((T_MFW_HDR *) win)->data;
     T_M_DEL_ALL    * data = (T_M_DEL_ALL *)win_data->user;
 
     TRACE_FUNCTION ("SmsMenu_standard_dialog_cb()");
 
-
   switch (Identifier)
   {
   case SMSMENU_ID_DELETEALL:
@@ -1628,12 +1545,12 @@
 int SmsMenu_sms_delete_all(T_MFW_HND win)
 {
     //T_MFW_HND  win  = mfw_parent (mfw_header());
-   //  T_DISPLAY_DATA DisplayInfo;
+    //  T_DISPLAY_DATA DisplayInfo;
     T_MFW_WIN      * win_data = ((T_MFW_HDR *) win)->data;
     T_M_DEL_ALL    * data = (T_M_DEL_ALL *)win_data->user;
 
     TRACE_FUNCTION("SmsMenu_sms_delete_all()");
-      //May 27, 2005    MMI-FIX-29869 x0018858
+    //May 27, 2005    MMI-FIX-29869 x0018858
 #ifdef FF_MMI_SMS_DYNAMIC
 	data->g_SmsMenu_messages = (T_MFW_SMS_MSG*)ALLOC_MEMORY (g_max_messages * sizeof(T_MFW_SMS_MSG)  );
 	g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, g_max_messages);
@@ -1642,7 +1559,6 @@
 #endif
     //NM 22.8 msgsLoadInfoDefaults2(&DisplayInfo);
 
-
     if (g_ListLength2 > 0)
     {
     	/* Display "Please wait" on the screen*/
@@ -1651,8 +1567,8 @@
 
 	// Feb 24, 2005 REF: CRR MMI-SPR-29102 xnkulkar
 	// As the user has already confirmed that all SMS messages are to be deleted, ''End All' key
-       // press is to be ignored. Call function mmi_dialog_information_screen_delete_all() instead of
-       // mmi_dialog_information_screen_forever().
+	// press is to be ignored. Call function mmi_dialog_information_screen_delete_all() instead of
+	// mmi_dialog_information_screen_forever().
 
 	// data->waiting_win = mmi_dialog_information_screen_forever(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT);
 
@@ -1662,17 +1578,17 @@
       	/* for the MFW EVENT "E_SMS_OK"           */
 
     	g_ListLength2 --;
-	 /*a0393213 OMAPS00109953 - memory passed as parameter*/
+	/*a0393213 OMAPS00109953 - memory passed as parameter*/
     	sms_msg_delete(data->g_SmsMenu_messages[g_ListLength2].index,data->g_SmsMenu_messages[g_ListLength2].mem);
-    	}
-	//May 27, 2005    MMI-FIX-29869 x0018858
+    }
+
+    //May 27, 2005    MMI-FIX-29869 x0018858
 #ifdef FF_MMI_SMS_DYNAMIC
-        if (g_ListLength2 == 0)
+    if (g_ListLength2 == 0)
 	FREE_MEMORY((U8*)data->g_SmsMenu_messages, g_max_messages * sizeof(T_MFW_SMS_MSG));
 #endif
-	/*SPR 2139, don't need "else" as empty list case handled earlier*/
+    /*SPR 2139, don't need "else" as empty list case handled earlier*/
     return 1;
-
 }
 
 /*******************************************************************************
@@ -1689,13 +1605,12 @@
 UBYTE SmsRead_convertMailbox(T_MFW_MAILBOX_ID i, char *mail_number, char *mail_alpha)
 {
 //  USHORT max_rcd;  // RAVI
-  USHORT nlen;
+    USHORT nlen;
 
-  char *international = mail_number; // Used to add '+' to the number if international
+    char *international = mail_number; // Used to add '+' to the number if international
 
     TRACE_FUNCTION ("SmsRead_convertMailbox()");
 
-
     // If international number, add the '+' symbol
     if (FFS_flashData.mbn_numTp & 0x10)
     {
@@ -1712,7 +1627,6 @@
     mail_alpha[nlen] = '\0';
 
     return TRUE;
-
 }
 
 static void SmsMenu_StandardEditor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
@@ -1726,7 +1640,6 @@
   {
     case INFO_KCD_LEFT:
 
-
       if (Identifier EQ V_ID_CALL )
       {
         callNumber(FFS_flashData.voice_mail);
@@ -1743,8 +1656,6 @@
       }
       /* Marcus: Issue 1490: 13/12/2002: End */
       V_destroy(win);
-
-
       break;
 
     case INFO_KCD_RIGHT:
@@ -1756,162 +1667,6 @@
   }
 }
 
-/* SPR#1428 - SH - New Editor: not required */
-#ifndef NEW_EDITOR
-/*******************************************************************************
-
- $Function:     SmsMenu_loadEditDefault
-
- $Description:
-
- $Returns:
-
- $Arguments:
-
-*******************************************************************************/
-
-void SmsMenu_loadEditDefault(T_EDITOR_DATA *editor_data)
-{
-    TRACE_FUNCTION ("SmsMenu_loadEditDefault()");
-
-      editor_data->editor_attr.win.px   = 6;
-      editor_data->editor_attr.win.py   = 12;
-      editor_data->editor_attr.win.sx   = 80;
-      editor_data->editor_attr.win.sy   = 20;
-      editor_data->editor_attr.edtCol = COLOUR_EDITOR_XX;
-      editor_data->editor_attr.font     = 0;
-      editor_data->editor_attr.mode    = edtCurBar1;
-      editor_data->editor_attr.controls   = 0;
-      editor_data->editor_attr.text      = '\0';
-        editor_data->editor_attr.size       = 0;
-    editor_data->hide         = FALSE;
-      editor_data->Identifier            = 0;  /* optional */
-      editor_data->mode               = DIGITS_MODE;
-    editor_data->destroyEditor      = TRUE;
-    editor_data->LeftSoftKey          = TxtSoftSelect;
-    editor_data->AlternateLeftSoftKey   = TxtNull;
-    editor_data->RightSoftKey         = TxtSoftBack;
-    editor_data->Identifier            =  0;
-    editor_data->TextId              = '\0';
-    editor_data->TextString           = NULL;
-    editor_data->min_enter         = 1;  // Avoid to return empty strings
-      editor_data->timeout              = FOREVER;
-    editor_data->Callback             = (T_EDIT_CB)SmsMenu_StandardEditor_cb;
-
-}
-
-#endif /* NEW_EDITOR */
-
-/* SPR#1428 - SH - New Editor: These functions moved here from MmiEditor.c */
-#ifdef EASY_TEXT_ENABLED
-
-/*******************************************************************************
-
- $Function:     eZitextIcon
-
- $Description:  Icon to be displayed if eZiText has been selected.
-
- $Returns:    None.
-
- $Arguments:  None.
-
-*******************************************************************************/
-
-int showeZiTextIcon(MfwMnu* m, MfwMnuItem* i)
-{
-	T_MFW_HND       win  = mfwParent(mfw_header());
-
-	/* BEGIN ADD: Sumit: Locosto*/
-		eZiTextWin = win;
-	/* END ADD: Sumit: Locosto*/
-	TRACE_FUNCTION ("showeZiTextIcon()");
-
-	if(Easy_Text_Available == TRUE)
-	{
-	  if(FFS_flashData.PredTextSelected == TRUE)
-	  {
-	    T_DISPLAY_DATA display_info;
-		dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtNull,  TxtNull, COLOUR_STATUS_EZITEXT);
-		dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)M_exeSendNew, FOUR_SECS, 0 );
-
-	    mmi_dialogs_insert_animation(info_dialog(win, &display_info), 400, (MfwIcnAttr*)&IconTexteZiText,1);
-	  }
-	  else if(FFS_flashData.PredTextSelected == FALSE)
-	  {
-	    M_exeSendNew(m,i);
-	  }
-	}
-	else
-	    M_exeSendNew(m,i);
-	return 1; /*a0393213 warnings removal-return statement added*/
-}
-
-
-/*******************************************************************************
-
- $Function:     EasyActivate
-
- $Description:  Icon to be displayed if eZiText has been selected.
-
- $Returns:    MFW_EVENT_CONSUMED.
-
- $Arguments:  None.
-
-*******************************************************************************/
-
-int Easy_Activate(MfwMnu* m, MfwMnuItem* i)
-{
-	T_MFW_HND win = mfwParent(mfw_header());
-	T_DISPLAY_DATA display_info;
-
-	if(FFS_flashData.PredTextSelected == FALSE)
-	{
-	  FFS_flashData.PredTextSelected = TRUE;
-	  flash_write();
-
-		dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText,  TxtActivated, COLOUR_STATUS_EZITEXT);
-		dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
-
-	  info_dialog(win, &display_info);
-
-	  return MFW_EVENT_CONSUMED;
-	}
-	return MFW_EVENT_CONSUMED;/*a0393213 warnings removal -  added return statement*/
-}
-
-/*******************************************************************************
-
- $Function:     EasyActivate
-
- $Description:  Icon to be displayed if eZiText has been selected.
-
- $Returns:    MFW_EVENT_CONSUMED.
-
- $Arguments:  None.
-
-*******************************************************************************/
-
-int Easy_DeActivate(MfwMnu* m, MfwMnuItem* i)
-{
-	T_MFW_HND win = mfwParent(mfw_header());
-	T_DISPLAY_DATA display_info;
-
-	if(FFS_flashData.PredTextSelected == TRUE)
-	{
-	  FFS_flashData.PredTextSelected =  FALSE;
-	  flash_write();
-
-	  dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText,  TxtDeActivated, COLOUR_STATUS_EZITEXT);
-	  dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
-	  info_dialog(win, &display_info);
-
-	  return MFW_EVENT_CONSUMED;
-
-	}
-	return MFW_EVENT_CONSUMED;/*a0393213 warnings removal*/
-}
-#endif /* EASY_TEXT_ENABLED */
-
 #ifdef TI_PS_FF_CONC_SMS
 /*******************************************************************************