diff src/ui/bmi/mmiSmsRead.c @ 92:c0052fe355d3

src/ui/bmi/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 08 Nov 2020 06:39:16 +0000
parents 67bfe9f274f6
children 0a0d54877239
line wrap: on
line diff
--- a/src/ui/bmi/mmiSmsRead.c	Sun Nov 08 05:12:05 2020 +0000
+++ b/src/ui/bmi/mmiSmsRead.c	Sun Nov 08 06:39:16 2020 +0000
@@ -2,29 +2,29 @@
 
 					CONDAT (UK)
 
-********************************************************************************                                                                              
+********************************************************************************
 
  This software product is the property of Condat (UK) Ltd and may not be
- disclosed to any third party without the express permission of the owner.                                 
-                                                                              
+ disclosed to any third party without the express permission of the owner.
+
 ********************************************************************************
 
- $Project name:	Basic MMI                                                      
- $Project code:	BMI                                                            
+ $Project name:	Basic MMI
+ $Project code:	BMI
  $Module:		SMS
  $File:		    MmiSmsRead.c
- $Revision:		1.0                                                       
-                                                                              
- $Author:		Condat(UK)                                                         
- $Date:		    25/10/00                                                      
-                                                                               
+ $Revision:		1.0
+
+ $Author:		Condat(UK)
+ $Date:		    25/10/00
+
 ********************************************************************************
-                                                                              
+
  Description:
- 
+
     Shared definitions of data elements are made in here
     and accessed via the primitive operations supplied
-                        
+
 ********************************************************************************
 
  $History: MmiSmsRead.c
@@ -32,7 +32,7 @@
       Apr 09, 2007 OMAPS00124879 x0039928(sumanth)
       Description : I sample crashes while reading the received SMS from the Agilent
       Solution     : Memory is allocated for temp_text.data
-      
+
       Feb 28, 2007 OMAPS00109953 a0393213(R.Prabakar)
       Description : Need to be able to store SMS in SIM/ME
       Solution     : Earlier, index alone was sufficient to identify messages. Now memory should also be taken care of.
@@ -41,34 +41,34 @@
    	Description: TC2.1.10(BMI/MFW) - English Editor - Reading Chinese message fails
    	Solution: 'Not Supported' string is displayed as Message editor title for a chinese message
    	received when english editor is set.
-   	
+
       	May 05, 2006    DR: OMAPS00071374 x0039928
-   	Description: CT-GCF[34.2.5.3]- MS failed to indicate ErrorCause "Protocol error, unspecified" 
+   	Description: CT-GCF[34.2.5.3]- MS failed to indicate ErrorCause "Protocol error, unspecified"
    	Solution: Display Info structure is initialized properly to display dialog "Message Deleted".
 
        Feb 07, 2006    DR: OMAPS00059261 x0pleela
-   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI 
+   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI
    	Solution: smsread_r_exec_cb(): avoiding display of sender's address in header for status reports during listing
    			smsread_getstatustext():renamed txtreport to txtreport
    			Replaced MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed
 
       	Feb 01, 2006    DR: OMAPS00059261 x0pleela
-   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI 
+   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI
    	Solution: Added a check for Status report to display a text "Report:Pending" during listing of this message
 			Made changes as per review comments
-   	
+
       	Jan 30, 2006    DR: OMAPS00059261 x0pleela
-   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI 
+   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI
    	Solution: Added code to read and display MT Status report
- 	
+
 	Mar 28, 2006    MMI-FIX-47813 x0035544
-   	Description: Not Available transient screen is displayed when Extract number option is selected 
+   	Description: Not Available transient screen is displayed when Extract number option is selected
    	in messages option screen.
-   	Solution: The necessary functionality is provided to extract the numbers in a message and display 
+   	Solution: The necessary functionality is provided to extract the numbers in a message and display
    	them appropriately.
-   	
+
  	May 27, 2005    MMI-FIX-29869 x0018858
-   	Description: There is a limitation on the number of messages that can be downloaded from 
+   	Description: There is a limitation on the number of messages that can be downloaded from
    	server even though there is space on the sim.
    	Solution: The limitation has been removed and the number of messages that can be dowloaded
    	has been modified to the masimum number that can be stored.
@@ -77,36 +77,36 @@
        Description: Reply path not supported while sending a reply.
        Solution: Added menu option for the reply path.
 
-       Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+       Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
   	Issue description:  BMI: using the tool nowSMS the voicemail indication via sms does not work
   	Solution: Instead of identifying voice using addr[0] and pid, we use dcs. Also, messages belonging
   	              to group "1100" are deleted when voicemail icon is displayed.
 
  	Feb 16, 2005 REF: CRR 28966 x0012851
- 	Description: Editing or forwarding of large MT messages (>160 characters) 
+ 	Description: Editing or forwarding of large MT messages (>160 characters)
  				shouldn't be allowed when Concatenation is set to 'OFF'
  	Solution: If the 'ConcatenateStatus' flag is FALSE, the 'if' check condition
- 				which allows the message to be edited or forwarded has been 
+ 				which allows the message to be edited or forwarded has been
  				modified for the same.
 
 	Dec 15,2004 REF: CRR 24396 xkundadu
-	Description: Phone crashes when a message is received while the 
+	Description: Phone crashes when a message is received while the
 			    'List Empty' dialog is displayed.
-	Solution: NULL check is added for the list_win handle before calling 
+	Solution: NULL check is added for the list_win handle before calling
 			listsDestroy() when an MT sms is receieved.
- 
+
 	 Dec 01, 2004   REF: CRR 24225 xnkulkar
 	 Description: Reset when forwarding SMS
-	 Solution: The message content is sent excluding the date/time info from the 
+	 Solution: The message content is sent excluding the date/time info from the
 	               original message, which was causing the reset as the max limit (161) was crossed.
- 	
+
 	 Sep 08, 2004    REF: CRR 24393  Deepa M. D
 	 Bug:Phone crashes when user tries to reply to a saved message in the Inbox
 	 Fix:The reply and Callnumber Option has been removed for the saved message.
-	25/10/00			Original Condat(UK) BMI version.	
+	25/10/00			Original Condat(UK) BMI version.
 	14/10/00			SPR 1257 - merged in issue 888 from b-sample line (extract
 						number from SMS improvements) and made changes to accommodate
-						Unicode SMSs containing numbers. 
+						Unicode SMSs containing numbers.
 	May 03, 2004    REF: CRR 13845  Deepa M
 	The  Forward menuitem added.
  $End
@@ -187,7 +187,7 @@
 #else
 #include "MmiEditor.h"
 #endif
-#include "MmiBookShared.h" // MZ 
+#include "MmiBookShared.h" // MZ
 #include "mmiSmsMenu.h"
 #include "mmismssend.h"
 #include "mmiSmsRead.h"
@@ -219,7 +219,7 @@
 #ifdef LSCREEN
 #define UCS2_MENU_TEXT_LEN ((MFW_TAG_LEN +10)*2 +4)/*SPR 2686 only need name+status text*/
 #else
-#define UCS2_MENU_TEXT_LEN 36 /*mc SPR 1242, no of bytes in latin unicode string which fills one whole line*/ 
+#define UCS2_MENU_TEXT_LEN 36 /*mc SPR 1242, no of bytes in latin unicode string which fills one whole line*/
 #endif
 
 #define MAX_EDITOR_HEADER_LENGTH 25
@@ -232,7 +232,7 @@
 #define MAX_NUMBER_SIZE 10 //Max Size of the number array to hold the extracted numbers
 #define MIN_NUM_LENGTH 3 //minimum length of the number to be extracted.
 
-// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
 extern BOOL invalidVm;
 
 extern UBYTE reply_path_bit;
@@ -268,9 +268,9 @@
 {
 	SHORT nb_sms_stored;
 	/*SPR 2530, need more info than just indexes*/
-	
+
 //    May 27, 2005    MMI-FIX-29869 x0018858
-//   	Description: There is a limitation on the number of messages that can be downloaded from 
+//   	Description: There is a limitation on the number of messages that can be downloaded from
 //   	server even though there is space on the sim.
 //   	Solution: The limitation has been removed and the number of messages that can be dowloaded
 //   	has been modified to the maximum number that can be stored.
@@ -280,7 +280,7 @@
 //    May 27, 2005    MMI-FIX-29869 x0018858
 //   	Changed from static to dynamic
 	wstring_t** sms_header; /* header displayed in the dynamic menu */
-#else  
+#else
 	T_MFW_SMS_MSG sms_messages[MAX_MESSAGES]; /* store info about the SMS: index... */
 	wstring_t* sms_header[MAX_MESSAGES]; /* header displayed in the dynamic menu */
 #endif
@@ -383,7 +383,7 @@
 {
 	READ_SMS_LIST,
 	READ_SELECTED_SMS
-} g_sms_state;	
+} g_sms_state;
 
 //MZ 7/02/01 tmp enums.
 
@@ -404,7 +404,7 @@
     0,                                   /* number of items     */
 	COLOUR_LIST_SMS,
 	TxtMessages,
-	NULL, 
+	NULL,
 	MNUATTRSPARE
 
 };
@@ -417,7 +417,7 @@
 	MNU_LEFT | MNU_LIST | MNU_CUR_LINE,		/* centered page menu */
 	(U8)-1,										/* use default font  */
 	NULL,									/* with these items (filled in later) */
-	0,										/* number of items (filled in leter)  
+	0,										/* number of items (filled in leter)
 
 */
 	COLOUR_LIST_XX,							/* Colour */
@@ -428,7 +428,7 @@
 
 
 /* x0039928 - Lint warning fix
-static SHORT g_sms_list_counter; 
+static SHORT g_sms_list_counter;
 static SHORT g_nb_line_sms; */
 
 static int search_index;	/* SPR888 - SH - keeps track of position within SMS for extract number */
@@ -444,7 +444,7 @@
 
 /* we need this variable "read_status" to know which sms message we are going
    to edit (user pressed in the sms menu-> EDIT)
-   because SMS_MT & SMS_MO have different size of character 
+   because SMS_MT & SMS_MO have different size of character
    (current length saved in "current_sms_len") !!
    SMS_MT includes additional TIME, DATE and NUMBER and we dont want
    to show it when we are editing.
@@ -453,9 +453,9 @@
 static USHORT current_sms_len= 0;
 
 //	Dec 15,2004 REF: CRR 24396 xkundadu
-//	Description: Phone crashes when a message is received while the 
+//	Description: Phone crashes when a message is received while the
 //			    'List Empty' dialog is displayed.
-//	Solution: NULL check is added for the list_win handle before calling 
+//	Solution: NULL check is added for the list_win handle before calling
 //			listsDestroy() function  when an MT sms is receieved.
 
 // This checks whether the 'List Empty' dialog is present or not.
@@ -484,7 +484,7 @@
 static int SmsRead_R_OPTExeEdit(MfwMnu* m, MfwMnuItem* i);
 
 /*SPR 2530,, old code which displays the contents of the SMS messages in the SMS list
-has been compiled out using the macro ORIGINAL_SMS_LIST.  
+has been compiled out using the macro ORIGINAL_SMS_LIST.
 If ORGINAL_SMS_LIST is defined, then the old list is shown, otherwise the new kind of SMS
 list is shown*/
 
@@ -500,7 +500,7 @@
 /*a0393213 OMAPS00109953 - memory where the message, which we're trying to read again, resides*/
 static T_MFW_SMS_MEM retry_mem=MFW_MEM_NOTPRESENT;
 /*a0393213 OMAPS00109953 - memory added as parameter*/
-void retry_sms_read(int index, T_MFW_SMS_MEM sms_memory);		
+void retry_sms_read(int index, T_MFW_SMS_MEM sms_memory);
 int retry_sms_read_tim_cb(MfwEvt event, MfwTim *timer_info);
 
 /* R is the identifier used for the function of the Read menu window */
@@ -567,7 +567,7 @@
     {0,0,0,(char *)TxtEdit,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none},
 	{0,0,0,(char *)TxtForward,0,(MenuFunc)SmsRead_R_OPTExeEdit,item_flag_none},
     {0,0,0,(char *)TxtExtractNumber,0,(MenuFunc)SmsRead_R_OPTExeStoreNumber,item_flag_none},
-    
+
 };
 
 //Sep 08, 2004    REF: CRR 24393  Deepa M. D
@@ -587,13 +587,13 @@
 
  $Function:    	charPtrToUBYTEPtr
 
- $Description:	Converts a char ptr to a UBYTE ptr. The procedures can be replaced by macro 
+ $Description:	Converts a char ptr to a UBYTE ptr. The procedures can be replaced by macro
  				once all conversions are confirmed as valid.
- 				
+
  $Returns:		data set to new type
 
  $Arguments:	data -data item of input type.
- 
+
 *******************************************************************************/
 #ifndef MMI_USE_MACROS
 UBYTE 	charToUBYTE				( char chr )	{	return((UBYTE)chr);		}
@@ -611,13 +611,13 @@
 #else
 #define 	charToUBYTE			(UBYTE)
 #define 	charPtrToUBYTEPtr	(UBYTE*)
-#define 	SHORTToUBYTE		(UBYTE)	
+#define 	SHORTToUBYTE		(UBYTE)
 
 #define		UBYTEPtrToCharPtr	(char*)
 #define		UBYTEToChar			(char)
 #define		USHORTPtrToCharPtr	(char*)
 
-#define 	charToUSHORT		(USHORT)	
+#define 	charToUSHORT		(USHORT)
 #define 	UBYTEToUSHORT		(USHORT)
 #define		charPtrToUSHORTPtr	(USHORT*)
 #endif
@@ -630,12 +630,12 @@
  $Function:    	SmsRead_R_start
 
  $Description:	Start the creation of the main window for SMS reading
- 
- $Returns:		mfw window handler 
+
+ $Returns:		mfw window handler
 
  $Arguments:	parent_window - Parent window handler
  				menuAttr	  - Menu attributes.
- 
+
 *******************************************************************************/
 T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr)
 {
@@ -643,7 +643,7 @@
     /*SPR2132, if the list window already exists, destroy it before creating a new one*/
 	if (sms_read_win != NULL)
 		SmsRead_R_destroy(sms_read_win);
-	
+
     TRACE_FUNCTION ("SmsRead_R_start()");
 	/*SPR 1991 use ssms_read_win rather than a local var*/
     sms_read_win = SmsRead_R_create (parent_window);
@@ -661,11 +661,11 @@
  $Function:    	SmsRead_R_create
 
  $Description:	create the SMS read window (dynamic list of all the SMS)
- 
- $Returns:		mfw window handler 
+
+ $Returns:		mfw window handler
 
  $Arguments:	parent_window - Parent window handler
- 
+
 *******************************************************************************/
 static T_MFW_HND SmsRead_R_create(MfwHnd parent_window)
 {
@@ -678,13 +678,13 @@
      * Create window handler
      */
 
-    data->win = 
+    data->win =
 	win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_win_cb);
     if (data->win EQ NULL)
 	{
 	    return NULL;
 	}
-    /* 
+    /*
      * connect the dialog data to the MFW-window
      */
 
@@ -707,11 +707,11 @@
  $Function:    	SmsRead_R_destroy
 
  $Description:	Destroy the SMS read window (dynamic list of all the SMS)
- 
+
  $Returns:		none
 
  $Arguments:	own_window - window handler
- 
+
 *******************************************************************************/
 
 static void SmsRead_R_destroy(MfwHnd own_window)
@@ -720,7 +720,7 @@
     T_SMSREAD_R     * data;
 	USHORT i;
 
-	
+
     TRACE_FUNCTION ("SmsRead_R_destroy()");
 
     if (own_window)
@@ -731,47 +731,47 @@
 		{
 		    /*
 		     * Delete WIN handler
-		     */ 
+		     */
 			sms_delete(data->sms_handle);
 
-			
-			/*SPR 2132, if the message options menu or the messaeg display screen exist, 
+
+			/*SPR 2132, if the message options menu or the messaeg display screen exist,
 			destroy them */
 			if (option_mnu_win)
-			{	
+			{
 				SmsRead_R_OPT_destroy(option_mnu_win);
-				
+
 			}
 			if (message_win)
 			{
    	           SmsRead_R_TEXTEDT2_destroy(message_win);
    	           message_win = 0;
-			}	
+			}
 			/*SPR 2132 end*/
-			
+
 			if (info_win)
 			{
    	           SEND_EVENT(info_win,DIALOG_DESTROY,0,0 );
    	           info_win = 0;
    	        }
 			if (list_win){
-				
+
    	           SEND_EVENT(list_win/*SPR1991*/,E_LIST_DESTROY/*SPR 2132*/,0,0 );
    	           list_win = 0;
-			}	
+			}
 		    win_delete (data->win);
 		   	{
 
 		    }
 
-		    /*     
+		    /*
 		     * Free Memory
 		     */
 
 			/* Free the data allocated for the name associated to the phone number */
 			if (data->sms_editor_data.assoc_name != NULL)
 				FREE_MEMORY( (void *)data->sms_editor_data.assoc_name, strlen(data->sms_editor_data.assoc_name) + 1);
-			
+
 			/* Free the data allocated for the dynamic list */
 			if (data->menu_list_data != NULL)
 			{
@@ -801,15 +801,15 @@
 
  $Function:    	SmsRead_R_exec_cb
 
- $Description:	Exec callback function of the SMS read window (dynamic list of 
+ $Description:	Exec callback function of the SMS read window (dynamic list of
  				all the SMS)
- 
+
  $Returns:		none
 
  $Arguments:	win - window handler
  				event - mfw event
  				parameter - optional data.
- 
+
 *******************************************************************************/
 void SmsRead_R_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
     /* callback handler for events sent to to trigger execution */
@@ -832,7 +832,7 @@
 	win_data = getWinData(win); //((T_MFW_HDR *))->data;
 	data = getUserData_T_SMSREAD_R(win_data);
     list_data = &data->sms_list_data;
-	
+
     TRACE_FUNCTION ("SmsRead_R_exec_cb()");
 
     switch (event)
@@ -859,26 +859,26 @@
             DisplayInfo.TextId	= TxtPleaseWait;
             //DisplayInfo.TextId2  = TxtReady;
 			// Generic function for info messages
-			DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_dialog_cb; 
+			DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_dialog_cb;
 
             info_dialog(win, &DisplayInfo);
-	
+
 			break;
-		}		
+		}
 		/* We have to handle E_SMS_MO and E_SMS_MT MFW events, in order to retrieve the SMS */
-		MfwEvents = E_SMS_MT  | E_SMS_MO | E_SMS_MT_RECEIVED | E_SMS_MO_AVAIL| 
-		            E_SMS_ERR | E_SMS_OK | E_SMS_MEM_FREE    | E_SMS_MEM_FULL; 
-		
+		MfwEvents = E_SMS_MT  | E_SMS_MO | E_SMS_MT_RECEIVED | E_SMS_MO_AVAIL|
+		            E_SMS_ERR | E_SMS_OK | E_SMS_MEM_FREE    | E_SMS_MEM_FULL;
+
   		data->sms_handle = sms_create(win,MfwEvents,(MfwCb)SmsRead_R_mfw_cb);
 
 
-  		/* Get info on the stored messages 
+  		/* Get info on the stored messages
 		   According to sms_list_type filter some specific type (new, read...) */
   		/*MC SPR 2530, change sms_index_list to sms_message_list, we need additional info*/
 #ifdef FF_MMI_SMS_DYNAMIC
-  		list_data->nb_sms_stored = sms_message_list(sms_list_type, list_data->sms_messages, g_max_messages); 
+  		list_data->nb_sms_stored = sms_message_list(sms_list_type, list_data->sms_messages, g_max_messages);
 #else
-  		list_data->nb_sms_stored = sms_message_list(sms_list_type, list_data->sms_messages, MAX_MESSAGES); 
+  		list_data->nb_sms_stored = sms_message_list(sms_list_type, list_data->sms_messages, MAX_MESSAGES);
 #endif
   		/* we want to get the whole SMS list */
   		if (list_data->nb_sms_stored > 0)
@@ -892,14 +892,14 @@
 			/* global counter to decrement each time a message is read */
 			g_sms_list_counter = list_data->nb_sms_stored - 1;
 
-			/* Initialise counter for number of entries in sms list. used to call the correct 
+			/* Initialise counter for number of entries in sms list. used to call the correct
 			   no of FreeAllocs MZ 8/03/01  */
 			g_nb_line_sms =0;
-	
+
 			/* x0045876, 14-Aug-2006 (WR - "status" was declared but never referenced)*/
 			/*a0393213 OMAPS00109953 - memory passed as parameter*/
  			sms_read(MFW_SMS_MESSAGE, (unsigned char)(list_data->sms_messages[g_sms_list_counter]).index,(list_data->sms_messages[g_sms_list_counter]).mem);
-			
+
   		#else
   		/*SPR 2530, instead of starting to raed the SMS list in a chain , just copy SMS status info
   		and sender names to list*/
@@ -909,12 +909,12 @@
   			BOOL unicode_flag= FALSE;
   			UBYTE output_alphabet= MFW_ASCII;
   			char* name_pointer = NULL;
-				
+
 			// May 27, 2005    MMI-FIX-29869 x0018858
 #ifdef FF_MMI_SMS_DYNAMIC
 		      //  Memory allocation done here
 			list_data->sms_header = (wstring_t **) ALLOC_MEMORY (g_max_messages * sizeof(wstring_t)  );
-#endif	
+#endif
 
 			/*for each entry in the message list*/
 			for (i=0;i<list_data->nb_sms_stored; i++)
@@ -929,7 +929,7 @@
 				//Use common procedure to display status info.]
 				//x0pleela 07 Feb, 2006 DR: OMAPS00059261
 				//check for Status report type and send MFW_SMS_STATRPT as status
-				if( list_data->sms_messages[i].msg_type  EQ MFW_SMS_STATRPT) 
+				if( list_data->sms_messages[i].msg_type  EQ MFW_SMS_STATRPT)
 				{
 				  strcpy(sms_text_ascii, MmiRsrcGetText(TxtReport));
 				  txt_len = strlen( sms_text_ascii);
@@ -949,7 +949,7 @@
 				if (list_data->sms_messages[i].stat == MFW_SMS_UNREAD || list_data->sms_messages[i].stat == MFW_SMS_READ)
 				{	/*if phonebook entry found*/
 					if (bookFindNameInPhonebook( list_data->sms_messages[i].addr.number, &phonebook_entry ))
-					{	
+					{
 						/*if name isn't blank*/
 						if (phonebook_entry.name.len >0)
 						{	/*if unicode tag we have to make some adjustments*/
@@ -960,7 +960,7 @@
 								/*SPR2530 moved conversion here*/
 								//x0pleela 07 Feb, 2006 DR: OMAPS00059261
 								//Donot display sender's address for status report
-								if( list_data->sms_messages[i].msg_type  NEQ MFW_SMS_STATRPT) 
+								if( list_data->sms_messages[i].msg_type  NEQ MFW_SMS_STATRPT)
 								  ATB_convert_String(name_pointer, phonebook_entry.name.dcs&0x0c,  phonebook_entry.name.len,
 												  &sms_text_ascii[txt_len],output_alphabet , UCS2_MENU_TEXT_LEN-txt_len, TRUE);
 							}
@@ -973,7 +973,7 @@
 							if( list_data->sms_messages[i].msg_type  NEQ MFW_SMS_STATRPT)
 							  ATB_convert_String(name_pointer, MFW_ASCII,  phonebook_entry.name.len,
 								&sms_text_ascii[txt_len],output_alphabet , UCS2_MENU_TEXT_LEN-txt_len, TRUE);
-						
+
 							}
 						}
 					}
@@ -986,7 +986,7 @@
 						ATB_convert_String(list_data->sms_messages[i].addr.number, MFW_ASCII,  MFW_NUM_LEN,
 							&sms_text_ascii[txt_len],output_alphabet ,UCS2_MENU_TEXT_LEN-txt_len, TRUE);
 					}
-						
+
 				}
 				/* use truncation function to copy message header to list*/
 				resources_truncate_to_screen_width((char*)sms_text_ascii,0,(char*) list_data->sms_header[i], UCS2_MENU_TEXT_LEN, SCREEN_SIZE_X, unicode_flag);
@@ -1006,13 +1006,13 @@
 		/* Call the recreate function that will create and display a dynamic list from the list of SMS */
 	    listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_R_smslist_cb,0);
 		break;
-		
+
 	case E_BACK:
 		/* Received an E_BACK event from the dynamic list --> suicide and E_RETURN to parent */
 	    l_parent = data->parent;
 		SmsRead_R_destroy(win);
-		SEND_EVENT(l_parent, E_RETURN, data->id, NULL);		
-	
+		SEND_EVENT(l_parent, E_RETURN, data->id, NULL);
+
 	case E_EXIT: // Terminate exit from sms send...
 	// May 27, 2005    MMI-FIX-29869 x0018858
 #ifdef FF_MMI_SMS_DYNAMIC
@@ -1022,8 +1022,8 @@
 			{
 				FREE_MEMORY((U8*)list_data->sms_header[i], UCS2_MENU_TEXT_LEN + 1 );
 			}
-		FREE_MEMORY((U8*)list_data->sms_header, g_max_messages * sizeof(wstring_t) );		
-		FREE_MEMORY((U8*)list_data->sms_messages, g_max_messages * sizeof(T_MFW_SMS_MSG));		
+		FREE_MEMORY((U8*)list_data->sms_header, g_max_messages * sizeof(wstring_t) );
+		FREE_MEMORY((U8*)list_data->sms_messages, g_max_messages * sizeof(T_MFW_SMS_MSG));
 	}
 #endif
 	    listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_R_smslist_cb,0);
@@ -1039,14 +1039,14 @@
 
  $Function:    	SmsRead_R_win_cb
 
- $Description:	Window callback function of the SMS read window (dynamic list of 
+ $Description:	Window callback function of the SMS read window (dynamic list of
  				all the SMS)
- 
+
  $Returns:		none
 
  $Arguments:	w - mfw window handler
  				e - mfw event
- 				
+
 *******************************************************************************/
 
 static int SmsRead_R_win_cb (MfwEvt e, MfwWin *w)    /* yyy window event handler */
@@ -1054,11 +1054,11 @@
 	TRACE_FUNCTION ("SmsRead_R_win_cb()");
 	switch (e)
 	{
-	case MfwWinVisible:  /* window is visible  */	    
+	case MfwWinVisible:  /* window is visible  */
 		break;
-	case MfwWinFocussed: /* input focus / selected   */	
-	case MfwWinDelete:   /* window will be deleted   */        
-	default:	    
+	case MfwWinFocussed: /* input focus / selected   */
+	case MfwWinDelete:   /* window will be deleted   */
+	default:
 		return MFW_EVENT_REJECTED;
 	}
 	return MFW_EVENT_CONSUMED;
@@ -1068,15 +1068,15 @@
 
  $Function:    	SmsRead_GetStatusText
 
- $Description:	Function to copy status string into array provided. 
- 
+ $Description:	Function to copy status string into array provided.
+
  $Returns:		number of characters used in the output array.
 
  $Arguments:	op_text_str - pointer to array to store the string
  				status - read status of text message.
 
  $History
-  SPR#780-GW-Created to allow consistent display of status in text message list 
+  SPR#780-GW-Created to allow consistent display of status in text message list
 *******************************************************************************/
 int SmsRead_GetStatusText( char* op_text_str, int status, T_MFW_SMS_MEM mem)
 {
@@ -1096,7 +1096,7 @@
 		txtId = TxtInvalidMessage;
 	else //assume if it is not marked as new/old/sent/unsent
 		txtId = TxtNull;
-	
+
 	// Check for the READ/UNREAD status of the MT message.
 	if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE)
 	{
@@ -1115,12 +1115,12 @@
 			{
 			strcat(op_text_str,"[P]");
 			}
-			
+
 		txt_len = strlen(op_text_str);
 	}
 	else //language = Chinese, copy unicode string
 	{
-		USHORT* unicodeStr; 
+		USHORT* unicodeStr;
 		USHORT* txtStr;
 		int uIndex;
 
@@ -1155,7 +1155,7 @@
 
  $Description:	MFW callback function of the SMS read window (dynamic list of all the SMS).
  				Only interesting events for reading are handled here
- 
+
  $Returns:		event status
 
  $Arguments:	parameter - optional data
@@ -1179,37 +1179,37 @@
 
 	T_MFW_SMS_MO * MoMessage;
 	T_MFW_SMS_MT * MtMessage;
-	
+
 	T_MFW_SMS_IDX msg_info;
 
-	
+
 
   	T_DISPLAY_DATA DisplayInfo;
-	
+
 	/* x0045876, 14-Aug-2006 (WR - "sms_len" & "sms_text" was declared but never referenced)*/
 	/* USHORT sms_len; */
 	/* char *sms_text; */
 //	int i;                      // RAVI
-	
-
-	win_data = getWinData(win); 
+
+
+	win_data = getWinData(win);
 	data = getUserData_T_SMSREAD_R(win_data);
 
 /* x0045876, 14-Aug-2006 (WR - "list_data" was set but never used)*/
 #ifdef  ORIGINAL_SMS_LIST
 	list_data = &(data->sms_list_data);
 #endif
-	
+
 	TRACE_FUNCTION("SmsRead_R_mfw_cb");
 
 	switch(event)
 	{
- 		case E_SMS_OK: 
+ 		case E_SMS_OK:
 			TRACE_EVENT("SmsRead_R_mfw_cb case:E_SMS_OK ");
 			if(deleting_win)
 			{
 				T_MFW_SMS_STAT  sms_list_type = MFW_SMS_ALL;
-				
+
 				listsDestroy(list_win);
 				list_win=0;
 			    SmsRead_R_destroy(data->win);
@@ -1220,7 +1220,7 @@
 				dlg_initDisplayData_TextId( &DisplayInfo, TxtNull, TxtNull, TxtDeleted,  TxtNull, COLOUR_STATUS_WAIT);
 				dlg_initDisplayData_events( &DisplayInfo, NULL, TWO_SECS, KEY_HUP );
 				info_dialog (0, &DisplayInfo);
-    
+
 				deleting_win = 0;
 			}
 
@@ -1244,7 +1244,7 @@
 			}
 			else
 			{
-			
+
 				/* x0045876, 14-Aug-2006 (WR - "sms_len" & "sms_text" was declared but never referenced)*/
 				/* sms_text = MoMessage->sms_msg; */
 				/* sms_len = MoMessage->msg_len; */
@@ -1271,7 +1271,7 @@
 			}
 
 			/*mc end*/
-			
+
 			if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
 			{	unicode = TRUE;/*MC, SPR 1442, we'll be displaying messages as unicode*/
 				/*SPR2175, use new function for conversion*/
@@ -1284,7 +1284,7 @@
 				/*SPR2175, use new function for conversion*/
 				ATB_convert_String(	MoMessage->sms_msg, input_type /*MC SPR1242*/, input_length/*SPR 1453*/,
 										&sms_text_ascii[txt_len] , MFW_ASCII,  MENU_TEXT_LENGTH-(txt_len+1), TRUE);
-				
+
 			}
 
 
@@ -1296,7 +1296,7 @@
 				resources_truncate_to_screen_width(sms_text_ascii,0,(char*) list_data->sms_header[g_sms_list_counter], UCS2_MENU_TEXT_LEN, SCREEN_SIZE_X, unicode);
 		}
 			TRACE_EVENT_P1("g_sms_list_counter = %d", g_sms_list_counter);
-			
+
 			g_sms_list_counter--;
 
 	        if (g_sms_list_counter >= 0)
@@ -1304,7 +1304,7 @@
 	        	// There are still messages to read.
 	        	/*SPR2260, if reading SMS fails, retry*/
 			/*a0393213 OMAPS00109953 - memory passed as parameter*/
-	            if (sms_read(MFW_SMS_MESSAGE, SHORTToUBYTE(list_data->sms_messages[g_sms_list_counter].index),(list_data->sms_messages[g_sms_list_counter].mem))== MFW_SMS_FAIL)		  
+	            if (sms_read(MFW_SMS_MESSAGE, SHORTToUBYTE(list_data->sms_messages[g_sms_list_counter].index),(list_data->sms_messages[g_sms_list_counter].mem))== MFW_SMS_FAIL)
 	            {
 					retry_sms_read(SHORTToUBYTE(list_data->sms_messages[g_sms_list_counter].index));
 	            }
@@ -1321,19 +1321,19 @@
 			}
 		}
 		// A particular SMS has been selected. We need to get all the info: full text, time stamp...
-		else 
+		else
 #endif
 			if (g_sms_state EQ READ_SELECTED_SMS)
 
 		{
 			data->sms_editor_data.sms_info = (T_MFW_SMS_PARA *)ALLOC_MEMORY (sizeof (T_MFW_SMS_PARA));
 			data->sms_editor_data.sms_type = MMI_SMS_MO;
-		
+
     		      memcpy(data->sms_editor_data.sms_info, (T_MFW_SMS_PARA *)MoMessage, sizeof(T_MFW_SMS_PARA));
 		      SmsRead_R_TEXTEDT2_start(win, (MfwMnuAttr *)&(data->sms_editor_data));
 		}
-	
-		break;				
+
+		break;
 		case E_SMS_MT:
 
 		MtMessage = (T_MFW_SMS_MT *)parameter;
@@ -1342,7 +1342,7 @@
 #ifdef  ORIGINAL_SMS_LIST
 
 		if (g_sms_state EQ READ_SMS_LIST)
-		{	
+		{
 			/*SPR 2176, if message is the last one requested from MFW*/
 			if (list_data->sms_messages[g_sms_list_counter].index == MtMessage->index)
 			{
@@ -1378,7 +1378,7 @@
 			}
 			else
 			  txt_len = SmsRead_GetStatusText( sms_text_ascii, msg_info.stat,msg_info.memory);
-	
+
 			/*MCSPR1242 don't trust the DCS, check for Unicode tag*/
 			if (MtMessage->sms_msg[0] == 0x80||MtMessage->dcs == MFW_DCS_UCS2 )
 			{	input_type = MFW_DCS_UCS2;/*MC*/
@@ -1388,7 +1388,7 @@
 			{	input_type = MFW_DCS_8bits;/*MC*/
 				input_length =  MtMessage->msg_len;/*1498, use MT length*/
 			}
-			
+
 			/*mc end*/
 			if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE)
 			{	unicode = FALSE; /*MC, SPR 1442, we'll be displaying messages as ASCII*/
@@ -1414,11 +1414,11 @@
 		    if(list_data->sms_header[g_sms_list_counter]  != NULL)
 		    {	/*MC, SPR 1442, use truncation function to copy message header to list*/
 		    	resources_truncate_to_screen_width(sms_text_ascii,0,(char*) list_data->sms_header[g_sms_list_counter], UCS2_MENU_TEXT_LEN, SCREEN_SIZE_X, unicode);
-				
+
 			}
 			else
 				TRACE_EVENT(" Memory allocation failed ");
-				
+
 			g_sms_list_counter--;
 
 	        if (g_sms_list_counter >= 0)
@@ -1440,13 +1440,13 @@
 					SmsRead_R_BuildList(win,1);
 	        }
 		  }
-		  else 
+		  else
 		  {	/*if index is not the one expected, pass event on to SmsIdle module*/
 		  	return MFW_EVENT_PASSED;
 		  }
-		  
+
 		}
-		else 
+		else
 #endif
 		if (g_sms_state EQ READ_SELECTED_SMS)
 		{
@@ -1454,17 +1454,17 @@
 			/*SPR 2176, if this was the message we requested*/
 			/*a0393213 OMAPS00109953 - mem is also taken into consideration*/
 			if (MtMessage->index == data->sms_editor_data.sms_index
-			    && MtMessage->memory == data->sms_editor_data.sms_mem 
+			    && MtMessage->memory == data->sms_editor_data.sms_mem
 				)
 			{
 				data->sms_editor_data.sms_info = (T_MFW_SMS_PARA *)ALLOC_MEMORY (sizeof (T_MFW_SMS_PARA));
-				
+
 				data->sms_editor_data.sms_type = MMI_SMS_MT;
 			    memcpy(data->sms_editor_data.sms_info, (T_MFW_SMS_PARA *)MtMessage, sizeof(T_MFW_SMS_PARA));
 				/*a0393213 OMAPS00109953 - memory passed as parameter*/
 				sms_copy_idx(MtMessage->index, &msg_info,MtMessage->memory);
-			
-				
+
+
 				SmsRead_R_TEXTEDT2_start(win, (MfwMnuAttr *)&(data->sms_editor_data));
 			}
 			else
@@ -1493,17 +1493,17 @@
 		/*SPR 2530 handle new message event*/
 	case E_SMS_MT_RECEIVED:
 		/*if we are not currently displaying a message*/
-		// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+		// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
 		// Added condition ' invalidVm == FALSE' before updating sms list
-		// to ensure that no blank voice mail sms entry is shown. 
-		if (message_win == NULL &&  invalidVm == FALSE) 
+		// to ensure that no blank voice mail sms entry is shown.
+		if (message_win == NULL &&  invalidVm == FALSE)
  		/*SPR 2530 Delete and recreate SMS list window to show updates*/
 		{ T_MFW_SMS_STAT  sms_list_type = MFW_SMS_ALL;
 
 //	Dec 15,2004 REF: CRR 24396 xkundadu
-//	Description: Phone crashes when a message is received while the 
+//	Description: Phone crashes when a message is received while the
 //			    'List Empty' dialog is displayed.
-//	Solution: NULL check is added for the list_win handle before calling 
+//	Solution: NULL check is added for the list_win handle before calling
 //			listsDestroy() function  when an MT sms is receieved.
 
 			// Check whether the sms list window is already destroyed or not.
@@ -1539,13 +1539,13 @@
  $Function:    	retry_sms_read.  Added for SPR2260
 
  $Description:	set up a timer to re-read sms at passed index in 100ms
- 
+
  $Returns:		none
 
  $Arguments:	index of sms to be re-read
- 				
+
 *******************************************************************************/
-/*a0393213 OMAPS00109953 - sms_memory parameter added - It indicates where (SIM/ME) the 
+/*a0393213 OMAPS00109953 - sms_memory parameter added - It indicates where (SIM/ME) the
 message which is to be read resides*/
 void retry_sms_read(int index, T_MFW_SMS_MEM sms_memory)
 {	TRACE_EVENT("retry_sms_read()");
@@ -1559,11 +1559,11 @@
  $Function:    	retry_sms_read_tim_cb.  Added for SPR2260
 
  $Description:	Callback function for retry SMS read timer
- 
+
  $Returns:		status int
 
  $Arguments:	event, timer data structure
- 				
+
 *******************************************************************************/
 int retry_sms_read_tim_cb(MfwEvt event, MfwTim *timer_info)
 {	TRACE_EVENT("retry_sms_read_tim_cb()");
@@ -1582,12 +1582,12 @@
  $Function:    	SmsRead_R_smslist_cb
 
  $Description:	Callback function for the dynamic list of the SMS read window.
- 
+
  $Returns:		none
 
  $Arguments:	Parent - window handler
  				ListData - Menu list data.
- 				
+
 *******************************************************************************/
 
 void SmsRead_R_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData)
@@ -1596,22 +1596,22 @@
 
 
     T_MFW_WIN       * win_data;
-    T_SMSREAD_R * data;    
-	  
+    T_SMSREAD_R * data;
+
 //	T_MFW_HND      * l_parent;   // RAVI
  //   SHORT            l_id;   // RAVI
 
 
 	TRACE_FUNCTION("SmsRead_R_smslist_cb ");
-	
-	win_data = getWinData(Parent); 
+
+	win_data = getWinData(Parent);
 	data = getUserData_T_SMSREAD_R(win_data);
 
 	// In all the case, we need the index of the selected message
 	data->sms_editor_data.sms_index = data->sms_list_data.sms_messages[ListData->ListPosition].index;
 	/*a0393213 OMAPS00109953 - memory is also taken into account*/
 	data->sms_editor_data.sms_mem = data->sms_list_data.sms_messages[ListData->ListPosition].mem;
-	
+
 	if (ListData->Reason EQ LISTS_REASON_SELECT/* && ListData->KeyReason EQ KCD_LEFT*/)
 	{
 		TRACE_EVENT(">>> Reason:LISTS_REASON_SELECT ");
@@ -1628,8 +1628,8 @@
    			if (sms_read(MFW_SMS_MESSAGE, SHORTToUBYTE(data->sms_editor_data.sms_index ),data->sms_editor_data.sms_mem)== MFW_SMS_FAIL)
 	            {
 		            /*a0393213 OMAPS00109953 - memory passed as parameter*/
-				retry_sms_read(SHORTToUBYTE(data->sms_editor_data.sms_index ),data->sms_editor_data.sms_mem);						
-	            }		
+				retry_sms_read(SHORTToUBYTE(data->sms_editor_data.sms_index ),data->sms_editor_data.sms_mem);
+	            }
 		}
 	}
 
@@ -1659,14 +1659,14 @@
     || (ListData->Reason EQ LISTS_REASON_CLEAR ))
 	{
 		T_DISPLAY_DATA DisplayInfo;
-		
+
 		TRACE_EVENT(">>> Reason: LISTS_REASON_BACK/CLEAR ");
-		
+
 		/* show for a short period  "Message deleted" and go
 		   back to the previous menu-screen
 		*/
 		/*a0393213 OMAPS00109953*/
-		if((sms_msg_delete((UBYTE)data->sms_editor_data.sms_index,data->sms_editor_data.sms_mem) EQ MFW_SMS_OK)	
+		if((sms_msg_delete((UBYTE)data->sms_editor_data.sms_index,data->sms_editor_data.sms_mem) EQ MFW_SMS_OK)
 		   && (data->sms_editor_data.sms_index NEQ 0))
 		{
 
@@ -1677,8 +1677,8 @@
 			info_dialog(data->win, &DisplayInfo);
 
 		}
-	
-		/* destroy the read-sms-menu and go back to 
+
+		/* destroy the read-sms-menu and go back to
 		the previous screen
 		*/
 		listsDestroy(ListData->win);
@@ -1700,10 +1700,10 @@
 	    SmsRead_R_destroy(data->win);
 	}
 
-	
+
 	}
 	/*NM p032 end*/
-	
+
 }
 
 /*******************************************************************************
@@ -1712,27 +1712,27 @@
 
  $Description:	Dialog callback function of the SMS read window (dynamic list of all the SMS)
  				Case where SMS has not been initialized yet
- 
+
  $Returns:		status
 
  $Arguments:	win - current window handler
  				Identifier - window id
  				Reason - Event cause.
- 				
+
 *******************************************************************************/
 
 int SmsRead_R_dialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason)
 {
     T_MFW_WIN       * win_data;
-    T_SMSREAD_R * data;    
+    T_SMSREAD_R * data;
 	T_MFW_HND *lparent;
 
-	win_data = getWinData(win); 
+	win_data = getWinData(win);
 	data = getUserData_T_SMSREAD_R(win_data);
 	lparent = data->parent;
-	
+
     TRACE_FUNCTION ("SmsRead_dialog_cb()");
-	
+
 	switch (Reason)
 	{
 	case INFO_TIMEOUT:
@@ -1743,7 +1743,7 @@
 		SEND_EVENT(lparent, E_RETURN, data->id, NULL);
 
 //	Dec 15,2004 REF: CRR 24396 xkundadu
-//	Description: Phone crashes when a message is received while the 
+//	Description: Phone crashes when a message is received while the
 //			    'List Empty' dialog is displayed.
 
 	// set the variable to FALSE, since  'List empty' dialog has been destroyed 		.
@@ -1760,27 +1760,27 @@
  $Function:    	SmsRead_R_BuildList
 
  $Description:	Build the list of SMS for the dynamic list.
- 
+
  $Returns:		status
 
  $Arguments:	win - current window handler
- 
+
 *******************************************************************************/
 
 void SmsRead_R_BuildList(T_MFW_HND win, int inUnicode)
 {
 
     T_MFW_WIN       * win_data;
-    T_SMSREAD_R * data;    
+    T_SMSREAD_R * data;
 
     /* List is complete so present menu. */
     USHORT i;
 
     TRACE_FUNCTION("SmsRead_R_BuildList");
-	
-	win_data = getWinData(win); 
+
+	win_data = getWinData(win);
 	data = getUserData_T_SMSREAD_R(win_data);
-	
+
 	data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData));
 
 	if(data->menu_list_data == 0)
@@ -1788,7 +1788,7 @@
 		TRACE_EVENT("Failed memory alloc 1 ");
 		return;
 	}
-		/*SPR 2686, only allocate memory for the number of messages displayed*/	
+		/*SPR 2686, only allocate memory for the number of messages displayed*/
 	data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( ((data->sms_list_data).nb_sms_stored) * sizeof(T_MFW_MNU_ITEM) );//JVJE
 
 	if(data->menu_list_data->List == 0)
@@ -1796,15 +1796,15 @@
 		TRACE_EVENT("Failed memory alloc 2");
 		return;
 	}
-		
-	
+
+
 	for (i = 0; i < ((data->sms_list_data).nb_sms_stored); i++)
 	{
 		mnuInitDataItem(&data->menu_list_data->List[i]);
 		data->menu_list_data->List[i].str  = (char *)(data->sms_list_data).sms_header[i];
-		data->menu_list_data->List[i].flagFunc = item_flag_none; 
+		data->menu_list_data->List[i].flagFunc = item_flag_none;
 	}
-	
+
    	data->menu_list_data->ListLength =(data->sms_list_data).nb_sms_stored;
 	data->menu_list_data->ListPosition = 1;
 	data->menu_list_data->CursorPosition = 1;
@@ -1816,13 +1816,13 @@
 		data->menu_list_data->RightSoftKey = TxtDelete;
 	else
 		data->menu_list_data->RightSoftKey = TxtSoftBack;
-		
+
 	data->menu_list_data->KeyEvents = KEY_ALL;
 	data->menu_list_data->Reason = 0;
 	data->menu_list_data->Strings = TRUE;
  	data->menu_list_data->Attr   = (MfwMnuAttr*)&readSMS_menuAttrib;
 	data->menu_list_data->autoDestroy    = FALSE;
- 	
+
     /* Create the dynamic menu window */
 listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_R_smslist_cb,inUnicode);
 list_win = data->menu_list_data->win;
@@ -1839,7 +1839,7 @@
  $Function:    	SmsRead_R_OPTExeDelete
 
  $Description:	Called when the user press Delete in the Option menu
- 			
+
  $Returns:		event status.
 
  $Arguments:	m - pointer to menu.
@@ -1855,7 +1855,7 @@
 	/* access to data from parent   */
     T_MFW_HDR    * parent      =  data->parent;
     T_MFW_WIN    * win_data2   =  ((T_MFW_HDR *)parent)->data;
-    
+
     T_SMSREAD_R_TEXTEDT2  * parent_data =  (T_SMSREAD_R_TEXTEDT2 *)win_data2->user;
 //    May 27, 2005    MMI-FIX-29869 x0018858
 #ifdef FF_MMI_SMS_DYNAMIC
@@ -1870,14 +1870,14 @@
 	/*a0393213 OMAPS00109953*/
 	T_MFW_SMS_MEM deleting_mem = parent_data->sms_editor_data->sms_mem;
 #ifdef FF_MMI_SMS_DYNAMIC
-	temp_message_list = (T_MFW_SMS_IDX*)ALLOC_MEMORY(g_max_messages*sizeof(T_MFW_SMS_IDX));	  
+	temp_message_list = (T_MFW_SMS_IDX*)ALLOC_MEMORY(g_max_messages*sizeof(T_MFW_SMS_IDX));
 #endif
 	TRACE_FUNCTION("SmsRead_R_OPTExeDelete");
 #ifdef MMI_LITE
 	/*SPR 2686 destroy option window to reduce memory usage*/
 		if (mfwCheckMemoryLeft() < 400)
 			SmsRead_R_OPT_destroy(option_mnu_win);
-#endif	
+#endif
 	/*SPR2530, check if message index in current list of messages*/
 #ifdef FF_MMI_SMS_DYNAMIC
 	no_of_messages = sms_index_list(MFW_SMS_ALL, temp_message_list, g_max_messages);
@@ -1906,13 +1906,13 @@
 		   		/*SPR 2686, only destroy option menu window if it hasn't already been destroyed*/
 		   		if (option_mnu_win)
 		   				SmsRead_R_OPT_destroy(option_mnu_win);
-		   		
+
 			}
 
 		}
 		else
-		{		   		
-			
+		{
+
 			/*SPR2530, don't delete option and display windows, just show failure*/
 			mmi_dialog_information_screen(0,TxtFailed, NULL, NULL, COLOUR_STATUS_WAIT);
 		}
@@ -1922,7 +1922,7 @@
 		/*SPR2530, don't delete option and display windows, just show failure*/
 		mmi_dialog_information_screen(0,TxtFailed, NULL, NULL, COLOUR_STATUS_WAIT);
 	}
-   
+
 //    May 27, 2005    MMI-FIX-29869 x0018858
 #ifdef FF_MMI_SMS_DYNAMIC
 //   Free the allocated memory
@@ -1936,7 +1936,7 @@
  $Function:    	SmsRead_R_OPTExeReply
 
  $Description:	Called when the user press Reply in the Option menu
- 			
+
  $Returns:		event status.
 
  $Arguments:	m - pointer to menu.
@@ -1948,18 +1948,18 @@
 
     T_MFW_HND       win  = mfwParent(mfw_header());
     T_MFW_WIN     * win_data = ((T_MFW_HDR *)win)->data;
-    T_SMSREAD_R_OPT         * data = (T_SMSREAD_R_OPT *)win_data->user;	
-	
+    T_SMSREAD_R_OPT         * data = (T_SMSREAD_R_OPT *)win_data->user;
+
 	T_MFW_HDR    * parent      =  data->parent;
     T_MFW_WIN    * win_data2   =  ((T_MFW_HDR *)parent)->data;
-    
+
     T_SMSREAD_R_TEXTEDT2  * parent_data =  (T_SMSREAD_R_TEXTEDT2 *)win_data2->user;
     // March 2, 2005    REF: CRR 11536 x0018858
    //  T_MFW_SMS_INFO	sms_parameter;//Added for retreiving the Reply path. // RAVI
-	
+
 
 	TRACE_FUNCTION("SmsRead_R_OPTExeReply");
-		
+
 	    /* Copy the number and name information to the SMS buffer
 	    */
 	 /*MC SPR 1257, clear whole buffer in case of Unicode entry*/
@@ -1970,16 +1970,16 @@
 	{
 		if(parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number[0] == '+')
 		{
-			strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number); 
+			strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number);
 		}
 		else
 		{
-			strcpy((char *)SmsData.NumberBuffer,"+");				
-			strncat((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number,sizeof(SmsData.NumberBuffer)-2); 
+			strcpy((char *)SmsData.NumberBuffer,"+");
+			strncat((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number,sizeof(SmsData.NumberBuffer)-2);
 		}
 	}
 	else
-		strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number); 
+		strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number);
 	/* Marcus: Issue 1804: 12/03/2003: End */
 
               // March 2, 2005    REF: CRR 11536 x0018858
@@ -2018,14 +2018,14 @@
 			sms_read_win = NULL;
 		}
 		/* NM,  FTA 34.2.8  */
-		
+
 		/* p304 SH - call this after destroying editor & windows. parent_data is lost,
 		so use pointer saved from above */
 		SmsSend_SEND_start(win, (void *) &SmsData);
-    
-
-    
-	
+
+
+
+
     return 1;
 }
 
@@ -2034,7 +2034,7 @@
  $Function:    	SmsRead_R_OPTExeStoreNumber
 
  $Description:	Called when the user press Store Number in the Option menu
- 			
+
  $Returns:		event status.
 
  $Arguments:	m - pointer to menu.
@@ -2053,7 +2053,7 @@
 	//Mar 27, 2006 DR:OMAPS00047813 x0035544
 	 CHAR  number[MFW_NUM_LEN];
 	T_MFW_PHB_TON ton;
-	
+
 	TRACE_FUNCTION("SmsRead_R_OPTExeStoreNumber");
 
 	 /* Copy the number and name information to the SMS buffer
@@ -2061,26 +2061,26 @@
     //Mar 27, 2006 DR:OMAPS00047813 x0035544
 	ton = parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.ton;
    	strcpy(number, parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number);
-    	
+
 	/*SPR 2686 destroy windows before attempting to extract numbers.*/
-	// Destroy the text editor, rel memory. 
+	// Destroy the text editor, rel memory.
     SmsRead_R_TEXTEDT2_destroy(parent_data->win);
 	/* Destroy the Options Menu and text editor. */
 	SmsRead_R_OPT_destroy(data->win);
-	
-	//Mar 27, 2006 DR:OMAPS00047813 x0035544	
+
+	//Mar 27, 2006 DR:OMAPS00047813 x0035544
 	if(ton == MFW_TON_INTERNATIONAL &&
 		number[0]!='+' && strlen((char *)number)>0 )
 		/* SPR888 - SH - do not add + if already there */
 	{
 		strcpy((char *)SmsData.NumberBuffer,"+");
-		strcat((char *)SmsData.NumberBuffer,(char *)number); 		
+		strcat((char *)SmsData.NumberBuffer,(char *)number);
 	}
 	else
 	{
-		strcpy((char *)SmsData.NumberBuffer,(char *)number); 
-	}	
-	
+		strcpy((char *)SmsData.NumberBuffer,(char *)number);
+	}
+
 	if (read_status EQ MMI_SMS_MT)
 	{
 		/* MT -SMS has the additional information (Date, Time & Number)
@@ -2092,7 +2092,7 @@
 		//when we were reading the saved-SMS with the length of MAX_MSG_LEN
   		memcpy(SmsData.TextBuffer,sms_text_ascii,MAX_MSG_LEN_ARRAY);/* assumption: sms_text_ascii is still filled from reading the SMS*/
 	}
-	
+
 	/* SPR888 - SH - Start looking for numbers from beginning of SMS text */
 #if 0 //Mar 24, 2006 DR:OMAPS00047813 x0035544
 	search_index = 0;
@@ -2110,7 +2110,7 @@
 		//Search the phonebook for the sender number entry and display the tag and number.
 		if (bookFindNameInPhonebook((const char*)&SmsData.NumberBuffer[0], &pb_data) !=0)
 		{
-#ifdef NO_ASCIIZ			
+#ifdef NO_ASCIIZ
 			//Display the tag and number dialog.
 			/* SPR888 - SH - parent_data->parent changed to parent_data->win */
 			smsRead_NumberName_info_screen(0,(void *)&SmsData, (char*)pb_data.name.data);
@@ -2137,7 +2137,7 @@
   SEND_EVENT (win2, E_INIT, 0, 0);
 }
 
-   	
+
     return 1;
 }
 
@@ -2146,7 +2146,7 @@
  $Function:    	SmsRead_R_OPTExeEdit
 
  $Description:	Called when the user press Forward in the Option menu
- 			
+
  $Returns:		event status.
 
  $Arguments:	m - pointer to menu.
@@ -2165,7 +2165,7 @@
 	T_DISPLAY_DATA Dialog;
 
 	TRACE_FUNCTION("SmsRead_R_OPTExeEdit");
-#ifdef TI_PS_FF_CONC_SMS	
+#ifdef TI_PS_FF_CONC_SMS
 	if (FFS_flashData.ConcatenateStatus == TRUE )
 	{
 		 /* Copy the number and name information to the SMS buffer
@@ -2175,10 +2175,10 @@
 		{
 			/* MT -SMS has the additional information (Date, Time & Number)
 			   we dont want to show these when we are editing       */
-			   
+
 //	       	Dec 01, 2004   REF: CRR 24225 xnkulkar
 //	 		Description: Reset when forwarding SMS
-//	 		Solution: The message content is sent excluding the date/time info from the 
+//	 		Solution: The message content is sent excluding the date/time info from the
 //	               	original message, which was causing the reset as the max limit was crossed.
 	    		memcpy(SmsData.TextBuffer,&sms_text_ascii[current_sms_len + ORIGINAL_DATE_TIME_INFO],MAX_MSG_LEN_ARRAY);
 		}
@@ -2188,7 +2188,7 @@
 	  		memcpy(SmsData.TextBuffer,sms_text_ascii,MAX_MSG_LEN_ARRAY);/* assumption: sms_text_ascii is still filled from reading the SMS*/
 		}
 		SmsData.called_from_reply_item = FALSE;
-		
+
 		/* p304 SH save window pointer */
 		win = parent_data->win;
 		// Destroy the text editor, free memory
@@ -2205,10 +2205,10 @@
 			SmsRead_R_destroy(sms_read_win);
 			sms_read_win = NULL;
 		}
-				
+
    	     	/*SPR 1991 end*/
 		/* NM,  FTA 34.2.8  */
-		
+
 		/* p304 SH - call this after destroying editor & windows. parent_data is lost,
 		so use pointer saved from above */
 		SmsSend_SEND_start(win, (void *) &SmsData);
@@ -2217,10 +2217,10 @@
 	/* API - 19-03-03 - 1825 - Allow the editing of a single saved SMS if ConcatenateStatus is FLASE*/
 
 //	Feb 16, 2005 REF: CRR 28966 x0012851
-//	Description: Editing or forwarding of large MT messages (>160 characters) 
+//	Description: Editing or forwarding of large MT messages (>160 characters)
 // 				shouldn't be allowed when Concatenation is set to 'OFF'
 // 	Solution: If the 'ConcatenateStatus' flag is FALSE, the 'if' check condition
-//				which allows the message to be edited or forwarded has been 
+//				which allows the message to be edited or forwarded has been
 // 				modified for the same.
 	else if (FALSE==FFS_flashData.ConcatenateStatus)
 #endif /* TI_PS_FF_CONC_SMS*/
@@ -2239,7 +2239,7 @@
 			   we dont want to show these when we are editing       */
 //	       	Dec 01, 2004   REF: CRR 24225 xnkulkar
 //	 		Description: Reset when forwarding SMS
-//	 		Solution: The message content is sent excluding the date/time info from the 
+//	 		Solution: The message content is sent excluding the date/time info from the
 //	               		    original message, which was causing the reset as the max limit was crossed.
 	    		memcpy(SmsData.TextBuffer,&sms_text_ascii[current_sms_len + ORIGINAL_DATE_TIME_INFO],MAX_MSG_LEN_SGL);
 		}
@@ -2265,7 +2265,7 @@
 			SmsRead_R_destroy(sms_read_win);
 			sms_read_win = NULL;
 		}
-		/*SPR 1991 end*/		
+		/*SPR 1991 end*/
 		SmsSend_SEND_start(win, (void *) &SmsData);
 	}
 	/* API - 28-01-03 - 1628 - END */
@@ -2279,7 +2279,7 @@
 	/* Show the dialog
 	*/
 	info_dialog( win, &Dialog );
-	
+
 	}
     }
     return 1;
@@ -2291,7 +2291,7 @@
 
  $Description:	Start the creation of the Option Window from the Read SMS
   				Text window.
- 			
+
  $Returns:		mfw window handler
 
  $Arguments:	parent_window- pointer to menu.
@@ -2319,7 +2319,7 @@
  $Function:    	SmsRead_R_OPT_create
 
  $Description:	Create the Options window
- 			
+
  $Returns:		window handler
 
  $Arguments:	parent_window- pointer to parent window
@@ -2336,13 +2336,13 @@
      * Create window handler
      */
 
-    data->win = 
+    data->win =
 	win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_OPT_win_cb);
     if (data->win EQ NULL)
 	{
 	    return NULL;
 	}
-    /* 
+    /*
      * connect the dialog data to the MFW-window
      */
 
@@ -2355,7 +2355,7 @@
     /*
      * return window handle
      */
-	
+
     return data->win;
 }
 
@@ -2364,7 +2364,7 @@
  $Function:    	SmsRead_R_OPT_destroy
 
  $Description:	Destroy the Option window
- 			
+
  $Returns:		none
 
  $Arguments:	own_window- current window
@@ -2383,13 +2383,13 @@
 	    data = (T_SMSREAD_R_OPT *)win_data->user;
 
 	    if (data)
-		{	
+		{
 		    /*
 		     * Delete WIN handler
-		     */ 
+		     */
 		     win_delete (data->win);
 
-		    /*     
+		    /*
 		     * Free Memory
 		     */
 		    FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_OPT));
@@ -2407,7 +2407,7 @@
  $Function:    	SmsRead_R_OPT_exec_cb
 
  $Description:	Exec callback function for the Option window
- 			
+
  $Returns:		none
 
  $Arguments:	win- current window
@@ -2425,7 +2425,7 @@
     SHORT            l_id = 0;  // RAVI
 
 	T_MFW_EVENT         MfwEvents;
-	
+
     TRACE_FUNCTION ("SmsRead_R_OPT_exec_cb()");
 
 
@@ -2435,7 +2435,7 @@
 		TRACE_EVENT(">> SmsRead_R_OPT_exec_cb(), E_INIT ");
 		/* initialization of administrative data */
 		data->id = value;
-		
+
 		if(value == SmsRead_R_READSMS_OPT_ID)
 		{
 			data->kbd =      kbdCreate(data->win,KEY_ALL,         (MfwCb)SmsRead_R_OPT_kbd_cb);
@@ -2451,17 +2451,17 @@
 				data->menu =     mnuCreate(data->win,(MfwMnuAttr *)&SmsRead_R_OPTAttrib, E_MNU_ESCAPE, (MfwCb)SmsRead_R_OPT_mnu_cb);
 			}
 			mnuLang(data->menu,mainMmiLng);
-			
+
 			/* put the (new) dialog window on top of the window stack */
 			mnuUnhide(data->menu);
 			winShow(win);
 			break;
-		}	
+		}
 		else
 		{
 			// Catch the events concerning delete
 			MfwEvents = E_SMS_ERR | E_SMS_OK;
-			
+
 			data->sms = sms_create(data->win,MfwEvents,(MfwCb)SmsRead_R_OPT_mfw_cb);
 			data->sms_editor_data = (T_SMS_EDITOR_DATA *)parameter;
 		}
@@ -2480,18 +2480,18 @@
 			data->menu =     mnuCreate(data->win,(MfwMnuAttr *)&SmsRead_R_OPTAttrib, E_MNU_ESCAPE, (MfwCb)SmsRead_R_OPT_mnu_cb);
 		}
 		mnuLang(data->menu,mainMmiLng);
-		
+
 		/* put the (new) dialog window on top of the window stack */
 		mnuUnhide(data->menu);
    	    winShow(win);
 		break;
-	    
+
 	case E_BACK:
 	    l_parent = data->parent;
 		l_id = data->id;
 	    SmsRead_R_OPT_destroy(data->win);
 	    SEND_EVENT (l_parent, E_RETURN, l_id, NULL); /* forward event to parent */
-	
+
 	case E_ABORT:
 	case E_EXIT:
 	    SmsRead_R_OPT_destroy(data->win);
@@ -2507,7 +2507,7 @@
  $Function:    	SmsRead_R_OPT_mfw_cb
 
  $Description:	Exec callback function for the DEL_ALL_ACK window
- 			
+
  $Returns:		status
 
  $Arguments:	event - window event Id
@@ -2536,7 +2536,7 @@
 
 		break;
 
-	case E_SMS_OK: 
+	case E_SMS_OK:
 
 		/* go now back to the parent             */
 
@@ -2548,14 +2548,14 @@
 		break;
 	}
 	return 1; // ADDED BY RAVI - 28-11-2005
-}	
+}
 
 /*******************************************************************************
 
  $Function:    	SmsRead_R_OPT_mnu_cb
 
  $Description:	Menu callback function for the Option window
- 			
+
  $Returns:		status
 
  $Arguments:	e - mfw event Id
@@ -2596,7 +2596,7 @@
  $Function:    	SmsRead_R_OPT_win_cb
 
  $Description:	Window callback function for the Option window
- 			
+
  $Returns:		status
 
  $Arguments:	e - mfw event Id
@@ -2626,11 +2626,11 @@
  $Function:    	SmsRead_R_OPT_kbd_cb
 
  $Description:	Exec callback function for the Option window
- 			
+
  $Returns:		status
 
  $Arguments:	e - keyboard event Id
- 				k - keyboard data 
+ 				k - keyboard data
 *******************************************************************************/
 
 static int SmsRead_R_OPT_kbd_cb (MfwEvt e, MfwKbd *k)
@@ -2684,9 +2684,9 @@
 
  $Function:    	SmsRead_R_OPT_dialog_cb
 
- $Description:	Dialog callback function of the SMS read window (dynamic list 
+ $Description:	Dialog callback function of the SMS read window (dynamic list
  				of all the SMS). Case where SMS has not been initialized yet.
- 			
+
  $Returns:		status
 
  $Arguments:	win - window handler.
@@ -2699,9 +2699,9 @@
 	T_MFW_WIN *win_data = ((T_MFW_HDR *)win)->data;
 	T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user;
 	T_MFW_HND *lparent = data->parent;
-	
+
     TRACE_FUNCTION ("SmsRead_dialog_cb()");
-	
+
 	switch (Reason)
 	{
 	case INFO_TIMEOUT:
@@ -2722,7 +2722,7 @@
  $Function:    	SmsRead_DisplayStandardDialog
 
  $Description:	Display a standard dialog with no soft key and 3 seconds of display
- 			
+
  $Returns:		none
 
  $Arguments:	win - window handler.
@@ -2733,18 +2733,18 @@
 void SmsRead_DisplayStandardDialog(T_MFW_HND win, int TextId, ULONG duration)
 {
 	T_DISPLAY_DATA DisplayInfo;
-	
+
 	SmsMenu_loadDialogDefault(&DisplayInfo);
 
        DisplayInfo.TextId = TextId;
 	DisplayInfo.Time = duration;
-	DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_dialog_cb; 
+	DisplayInfo.Callback = (T_VOID_FUNC)SmsRead_R_dialog_cb;
 
 //	Dec 15,2004 REF: CRR 24396 xkundadu
-//	Description: Phone crashes when a message is received while the 
+//	Description: Phone crashes when a message is received while the
 //			    'List Empty' dialog is displayed.
 
-	// set the variable to TRUE since  'List empty' dialog is going to display. 
+	// set the variable to TRUE since  'List empty' dialog is going to display.
 	SmsListEmptyDlgPresent = TRUE;
    	 info_dialog(win, &DisplayInfo);
 }
@@ -2754,7 +2754,7 @@
  $Function:    	SmsRead_R_OPT_StandardDialog
 
  $Description:	Display a standard dialog with no soft key and 3 seconds of display
- 			
+
  $Returns:		none
 
  $Arguments:	win - window handler.
@@ -2768,7 +2768,7 @@
 	T_SMSREAD_R_OPT *data = (T_SMSREAD_R_OPT *)win_data->user;
 
 	T_DISPLAY_DATA DisplayInfo;
-	
+
 	SmsMenu_loadDialogDefault(&DisplayInfo);
 
     DisplayInfo.TextId = 0;
@@ -2787,8 +2787,8 @@
 
  $Function:    	string_CopyW2W
 
- $Description:	
- 			
+ $Description:
+
  $Returns:		none
 
  $Arguments:	strDestination - destination string
@@ -2811,14 +2811,14 @@
 
  $Function:    	SmsRead_R_TEXTEDT2_start
 
- $Description:	Start the creation of the SMS editor window (display of the text 
+ $Description:	Start the creation of the SMS editor window (display of the text
  				of one SMS)
- 
+
  $Returns:		win - window handler.
 
  $Arguments:	parent_window - current window handler
  				data - Menu attributes.
- 
+
 *******************************************************************************/
 
 T_MFW_HND SmsRead_R_TEXTEDT2_start(T_MFW_HND parent_window, MfwMnuAttr *data)
@@ -2840,11 +2840,11 @@
  $Function:    	SmsRead_R_TEXTEDT2_create
 
  $Description:	Create the SMS editor window (display of the text of one SMS)
- 
+
  $Returns:		window handler.
 
  $Arguments:	parent_window - current window handler
- 				
+
 *******************************************************************************/
 
 static T_MFW_HND SmsRead_R_TEXTEDT2_create(MfwHnd parent_window)
@@ -2857,14 +2857,14 @@
     /*
      * Create window handler
      */
-	
-    data->win = 
+
+    data->win =
 	win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)SmsRead_R_TEXTEDT2_win_cb);
     if (data->win EQ NULL)
 	{
 	    return NULL;
 	}
-    /* 
+    /*
      * connect the dialog data to the MFW-window
      */
 
@@ -2886,11 +2886,11 @@
  $Function:    	SmsRead_R_TEXTEDT2_destroy
 
  $Description:	Destroy the SMS editor window (display of the text of one SMS)
- 
+
  $Returns:		none
 
  $Arguments:	own_window - current window handler
- 				
+
 *******************************************************************************/
 
 static void SmsRead_R_TEXTEDT2_destroy(MfwHnd own_window)
@@ -2911,7 +2911,7 @@
 		{
 		    /*
 		     * Delete WIN handler
-		     */ 
+		     */
 
 			/* SPR#1428 - SH - New Editor changes */
 #ifdef NEW_EDITOR
@@ -2922,12 +2922,12 @@
 
 		    win_delete (data->win);
 
-			
-	        
+
+
 			FREE_MEMORY ((void *)data->sms_editor_data->sms_info, sizeof (T_MFW_SMS_PARA));
 
 		    FREE_MEMORY ((void *)data, sizeof (T_SMSREAD_R_TEXTEDT2));
-		
+
 		message_win = 0; /*SPR2132, make sure window pointer is reset*/
 		}
 	    else
@@ -2942,12 +2942,12 @@
  $Function:    	SmsRead_R_TEXT_editor_cb
 
  $Description:	Callback function for the text editor
- 
+
  $Returns:		none
 
  $Arguments:	win - current window handler
  				Identifier -Unique identifier.
- 				reason - event 
+ 				reason - event
 *******************************************************************************/
 
 static void SmsRead_R_TEXT_editor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
@@ -2962,7 +2962,7 @@
 
 	/* x0045876, 14-Aug-2006 (WR - "win_data2" was declared but never referenced)*/
     	/* T_MFW_WIN    * win_data2   =  ((T_MFW_HDR *)parent)->data; */
-	
+
 //    T_SMSREAD_R_TEXTEDT2  * parent_data =  (T_SMSREAD_R_TEXTEDT2 *)win_data2->user;  // RAVI
 
  //   T_MFW_SMS_STAT  sms_list_type = MFW_SMS_ALL;  // RAVI
@@ -2976,7 +2976,7 @@
 		//x0pleela 08 Feb, 2006 DR: OMAPS00059261
 		//Replacing MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed
 		//x0pleela 30 Jan, 2006 DR: OMAPS00059261
-		//Displaying different options screen for normal MT text message. 
+		//Displaying different options screen for normal MT text message.
 		//whereas, for staus report message, the message is deleted, since the option is "Delete" in LSK
 		if( data->sms_editor_data->sms_info->sms_mt.sms_msg_type EQ MFW_SMS_STATRPT)
 		{
@@ -3000,8 +3000,8 @@
 
 			}
 			else
-			{		   		
-				
+			{
+
 				/*SPR2530, don't delete option and display windows, just show failure*/
 				mmi_dialog_information_screen(0,TxtFailed, NULL, NULL, COLOUR_STATUS_WAIT);
 			}
@@ -3013,9 +3013,9 @@
 		// Present the user with an Options menu from the Read SMS text screen.:16/2/01
 			SmsRead_R_READSMS_OPT_start(win, (MfwMnuAttr*)&data->sms_editor_data);
 		}
-		
+
 		break;
-	          
+
 		case INFO_KCD_RIGHT:
 		case INFO_KCD_HUP:
 			SmsRead_R_TEXTEDT2_destroy(data->win);
@@ -3049,20 +3049,20 @@
 
  $Function:    	SmsRead_R_TEXTEDT2_exec_cb
 
- $Description:	Exec callback function of the SMS editor window (display of the 
+ $Description:	Exec callback function of the SMS editor window (display of the
  				text of one SMS)
- 
+
  $Returns:		none
 
  $Arguments:	win - current window handler
  				event - event id
  				value - unique id
- 				parameter - optional data. 
+ 				parameter - optional data.
 *******************************************************************************/
 
 void SmsRead_R_TEXTEDT2_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter)
     /* callback handler for events sent to to trigger execution */
-{	
+{
     T_MFW_WIN      * win_data = ((T_MFW_HDR *) win)->data;
     T_SMSREAD_R_TEXTEDT2          * data = (T_SMSREAD_R_TEXTEDT2 *)win_data->user;
     T_MFW_HND      * l_parent;
@@ -3098,13 +3098,13 @@
 	T_MFW_PHB_ENTRY  pb_entry;
 	USHORT index=0;
 	T_MFW_SMS_IDX msg_info;/*SPR 2530*/
-	
+
     TRACE_FUNCTION ("SmsRead_R_TEXTEDT2_exec_cb()");
 
     switch (event)
 	{
 	case E_INIT:
-	{  
+	{
 
 	    /* x0045876, 14-Aug-2006 (WR - "input_type" was declared but never referenced)*/
 #ifndef NEW_EDITOR
@@ -3115,11 +3115,11 @@
 	    data->id = value;
 
 		data->sms_editor_data = (T_SMS_EDITOR_DATA *)parameter;
-		
+
 		switch (data->sms_editor_data->sms_type)
 		{
 		case MMI_SMS_MO:
-			
+
 			/* where does we need that:
 			   For editor when the user wants to editing the sms-message
 			*/
@@ -3139,7 +3139,7 @@
 				main_text.dcs = ATB_DCS_UNICODE;
 			else
 				main_text.dcs = ATB_DCS_ASCII;
-		       ATB_string_Length(&main_text);  
+		       ATB_string_Length(&main_text);
 			/*if this isn't an invalid message*/
 			if (msg_info.stat != MFW_SMS_INVALID)
 			{	/*set text string dcs, according to alphabet used for message*/
@@ -3159,14 +3159,14 @@
 					/*copy message text to string*/
 					temp_text.data = (UBYTE*)sms_text_ascii;
 				}
-				
+
 				ATB_string_Length(&temp_text);
 				/*concat message text into display string*/
 				ATB_string_Concat(&main_text, &temp_text);
-#ifdef TI_PS_FF_CONC_SMS					
+#ifdef TI_PS_FF_CONC_SMS
 				/*if this is an incomplete concat message, add "Incomplete Message" to end of display text*/
 				if (msg_info.concat_status == MFW_SMS_CONC_PART)
-				{	
+				{
 				       ATB_string_SetChar(&main_text, ATB_string_Length(&main_text),(USHORT)':');
 					if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
 						temp_text.dcs = ATB_DCS_UNICODE;
@@ -3176,7 +3176,7 @@
 					ATB_string_Length(&temp_text);
 					ATB_string_Concat(&main_text, &temp_text);
 				}
-#endif /*TI_PS_FF_CONC_SMS*/				
+#endif /*TI_PS_FF_CONC_SMS*/
 
 			}
 			else
@@ -3210,13 +3210,13 @@
 			}
 			else
 			{/*SPR2175, use new function for conversion*/
-			  
+
 				ATB_convert_String(	SmsMo->sms_msg, /*SmsMo->dcs*/input_type/*MC SPR1242*/ , SmsMo->msg_len,
 										sms_text_ascii, MFW_ASCII,  MAX_MSG_LEN, TRUE);
-				
+
 			}
 
-#endif			
+#endif
 			break;
 
 		case MMI_SMS_MT:
@@ -3224,7 +3224,7 @@
 				For editor when the user wants to editing the sms-message
 			 */
 			read_status = MMI_SMS_MT;
-			
+
 			SmsMt = (T_MFW_SMS_MT *)data->sms_editor_data->sms_info;
 			/*a0393213 OMAPS00109953*/
 			sms_copy_idx(SmsMt->index, &msg_info	,SmsMt->memory);/*SPR 2530*/
@@ -3238,10 +3238,10 @@
 				main_text.dcs = ATB_DCS_UNICODE;
 			else
 				main_text.dcs = ATB_DCS_ASCII;
-			ATB_string_Length(&main_text);  		
+			ATB_string_Length(&main_text);
 #endif
 			if (msg_info.stat != MFW_SMS_INVALID)/*SPR 1830*/
-			{	
+			{
 
             /* Marcus: Issue 1041: 05/09/2002: Start */
             // API - Copy number into buffer so when Call key is pressed in editor call is generated
@@ -3249,7 +3249,7 @@
             /* Marcus: Issue 1041: 05/09/2002: End */
 
             /* Marcus: Issue 1489: 13/12/2002: Start */
-            /*API - 1053 - 09-09-02 Copy the number into this buffer so that when 
+            /*API - 1053 - 09-09-02 Copy the number into this buffer so that when
 									a call is generated from the editor it is connected.
 			*/
             if(SmsMt->orig_addr.ton == MFW_TON_INTERNATIONAL)
@@ -3277,7 +3277,7 @@
 			}
 			else
 			{
-				
+
 				strcpy(sms_text_ascii, (char *)SmsData.NumberBuffer);
                 /* Marcus: Issue 1489: 13/12/2002: End */
 			}
@@ -3289,22 +3289,22 @@
 
 				memset(temp_string, '\0', PHB_MAX_LEN);
 				/*copy name into a text data structure*/
-				
-				/* CQ: 16780 Check the phonebook string format by testing the dcs. NOT the dcs values are Enum types and not the true dcs 
+
+				/* CQ: 16780 Check the phonebook string format by testing the dcs. NOT the dcs values are Enum types and not the true dcs
 				     values of the ADN store. 15-01-04 MZ */
 				if (pb_entry.name.dcs == MFW_DCS_UCS2  ||pb_entry.name.data[0] == 0x80 )
 					    temp_text.dcs = ATB_DCS_UNICODE;
 				else
 					temp_text.dcs = ATB_DCS_ASCII;
-				
+
 				if (temp_text.dcs != ATB_DCS_UNICODE)
-				{	
-					temp_text.data = (UBYTE*)pb_entry.name.data;	
+				{
+					temp_text.data = (UBYTE*)pb_entry.name.data;
 				}
-				
+
 				else
 				{
-					/*  CQ:16780 Check for unicode string type 15-01-04 MZ*/ 
+					/*  CQ:16780 Check for unicode string type 15-01-04 MZ*/
 					if(pb_entry.name.data[0] == 0x80)
 					{
 					 	pb_entry.name.len-=2;
@@ -3314,10 +3314,10 @@
 					{
 						memcpy(temp_string, &pb_entry.name.data[0], pb_entry.name.len);
 					}
-					
+
 					temp_text.data = (UBYTE*)temp_string;
-					
-					
+
+
 				}
 				ATB_string_Length(&temp_text);
 				/*add name text into main display string*/
@@ -3345,11 +3345,11 @@
 			}
 			else
 			{
-		
+
 #endif
 					if(strlen(sms_text_ascii) != 14 ) // number of character that can be displayed on one line.
 						sms_text_buffer[index++]='\n';
-				
+
 					sms_text_buffer[index++]='0'+SmsMt->sctp.day[0];
 					sms_text_buffer[index++]='0'+SmsMt->sctp.day[1];
 					sms_text_buffer[index++]='/';
@@ -3360,23 +3360,23 @@
 					sms_text_buffer[index++]='0'+SmsMt->sctp.year[1];
 					sms_text_buffer[index++]=',';
 					sms_text_buffer[index++]='\n';
-					
+
 					sms_text_buffer[index++] ='0'+SmsMt->sctp.hour[0];
 					sms_text_buffer[index++]='0'+SmsMt->sctp.hour[1];
 					sms_text_buffer[index++]=':';
 					sms_text_buffer[index++]='0'+SmsMt->sctp.minute[0];
 					sms_text_buffer[index++]='0'+SmsMt->sctp.minute[1];
-					sms_text_buffer[index++]='\n';	
+					sms_text_buffer[index++]='\n';
 #ifndef NEW_EDITOR
 		strcat(sms_text_ascii, sms_text_buffer);
 				msg_len = strlen(sms_text_ascii);
-				
+
 				/*
 					keep the length of the additional information (Date,Time & Number);
 					need it later for editing the sms messages (user pressed-> EDIT)
 				*/
 				current_sms_len = msg_len;
-				
+
 				/* SH - convert from original dcs once more */
 				/*SPR2175, use new function for conversion*/
 				ATB_convert_String(	SmsMt->sms_msg, /*SmsMt->dcs*/input_type /*MC SPR1242*/, SmsMt->msg_len,
@@ -3392,7 +3392,7 @@
 				ATB_string_Length(&temp_text);
 				ATB_string_Concat(&main_text, &temp_text);
 
-				
+
 				if ((SmsMt->dcs&0x0c) == MFW_DCS_UCS2)
 				{
 					temp_text.dcs = ATB_DCS_UNICODE;
@@ -3404,8 +3404,8 @@
 				else
 				{
 					temp_text.dcs = ATB_DCS_ASCII;
-					
-					/* CQ 16780 Convert incoming SMS text to ASCIII 15-01-04 MZ */ 
+
+					/* CQ 16780 Convert incoming SMS text to ASCIII 15-01-04 MZ */
 
 					/* Apr 09, 2007 OMAPS00124879 x0039928(sumanth) */
 					/* Fix : Memory is allocated for temporary data */
@@ -3417,8 +3417,8 @@
 					ATB_string_Concat(&main_text, &temp_text);
 					FREE_MEMORY((void*)temp_text.data,MAX_MSG_LEN);
 				}
-				
-#ifdef TI_PS_FF_CONC_SMS					
+
+#ifdef TI_PS_FF_CONC_SMS
 				/*if the message is a fragment of a concat message*/
 				if (msg_info.concat_status == MFW_SMS_CONC_PART)
 				{	ATB_string_SetChar(&main_text, ATB_string_Length(&main_text),(USHORT)':');
@@ -3431,7 +3431,7 @@
 					ATB_string_Length(&temp_text);
 					ATB_string_Concat(&main_text, &temp_text);
 				}
-#endif /*#ifdef TI_PS_FF_CONC_SMS*/				
+#endif /*#ifdef TI_PS_FF_CONC_SMS*/
 #endif
 			}
 			else
@@ -3456,7 +3456,7 @@
 
 			/* x0045876, 14-Aug-2006 (WR - "SmsCb" was set but never used)*/
 			/* SmsCb = (T_MFW_SMS_CB *)data->sms_editor_data->sms_info; */
-			
+
 			break;
 
 		}
@@ -3470,7 +3470,7 @@
 			/* SPR#1428 - SH - New Editor changes */
 #ifdef NEW_EDITOR
 			AUI_edit_SetDefault(&sms_editor_info);
-			
+
 			/* Include title for colour display */
 #ifdef COLOURDISPLAY
 			AUI_edit_SetDisplay(&sms_editor_info, ZONE_FULL_SK_TITLE_SCROLL, COLOUR_EDITOR, EDITOR_FONT);
@@ -3485,15 +3485,15 @@
 
 			//x0pleela 01 Feb, 2006 DR: OMAPS00059261
 			//Made changes as per review comments
-			
+
 			//x0pleela 30 Jan, 2006 DR: OMAPS00059261
-			//Displaying the LSK as "Delete" for MT Staus report and "Options" for normal MT Text message 
-			if (SmsMt!=NULL && SmsMt->sms_msg_type EQ MFW_SMS_STATRPT) 
+			//Displaying the LSK as "Delete" for MT Staus report and "Options" for normal MT Text message
+			if (SmsMt!=NULL && SmsMt->sms_msg_type EQ MFW_SMS_STATRPT)
 				AUI_edit_SetTextStr(&sms_editor_info, TxtDelete, TxtSoftBack, TxtMessage, NULL);
-			else 
+			else
 			{
 			// Oct 18, 2006    DR: OMAPS00099411  x0039928
-			// Fix: Message title is displayed as 'Not supported' 
+			// Fix: Message title is displayed as 'Not supported'
 				if (Mmi_getCurrentLanguage() != CHINESE_LANGUAGE)
 				{	if(SmsMt!=NULL && ((SmsMt->dcs&0x0c) == MFW_DCS_UCS2))
 						AUI_edit_SetTextStr(&sms_editor_info, TxtSoftOptions, TxtSoftBack, TxtNotSupported, NULL);
@@ -3503,14 +3503,14 @@
 				else
 						AUI_edit_SetTextStr(&sms_editor_info, TxtSoftOptions, TxtSoftBack, TxtMessage, NULL);
 			}
-			
+
 			/* Check if concatenated sms is activated */
-			
+
 			if (read_status EQ MMI_SMS_MO)
       			size	= MAX_MSG_LEN;
 			else
 				size	= MAX_EDITOR_LEN;
-/*SPR 2530, copy display screen to editor, alphabet depends on current lanaguage*/	
+/*SPR 2530, copy display screen to editor, alphabet depends on current lanaguage*/
 			if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
 			{
 				/* Unicode SMS message  */
@@ -3523,23 +3523,23 @@
 			}
 
 			data->editor_win = AUI_edit_Start(win,&sms_editor_info);  /* start the editor */
-			
+
 		#else /* NEW_EDITOR */
 
-			SmsSend_loadEditDefault(&sms_editor_info);			
+			SmsSend_loadEditDefault(&sms_editor_info);
 			sms_editor_info.editor_attr.text	    = (char *)sms_text_ascii;
 
 			if (read_status EQ MMI_SMS_MO)
       			sms_editor_info.editor_attr.size	= MAX_MSG_LEN;
 			else
 				sms_editor_info.editor_attr.size	= MAX_EDITOR_LEN;
-			sms_editor_info.min_enter				= 0; 
+			sms_editor_info.min_enter				= 0;
 
 			//x0pleela 08 Feb, 2006 DR: OMAPS00059261
 			//Replacing MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed
-			
+
 			//x0pleela 30 Jan, 2006 DR: OMAPS00059261
-			//Displaying the LSK as "Delete" for MT Staus report and "Options" for normal MT Text message 
+			//Displaying the LSK as "Delete" for MT Staus report and "Options" for normal MT Text message
 			if (SmsMt->sms_msg_type EQ MFW_SMS_STATRPT )
 			{
 				sms_editor_info.LeftSoftKey				= TxtDelete;
@@ -3551,9 +3551,9 @@
 			{
 				sms_editor_info.LeftSoftKey				= TxtSoftOptions;
 				sms_editor_info.AlternateLeftSoftKey	= TxtSoftOptions;
-			}	
+			}
 			sms_editor_info.RightSoftKey			= TxtSoftBack;
-			sms_editor_info.Identifier				= 0 ; 
+			sms_editor_info.Identifier				= 0 ;
 			sms_editor_info.destroyEditor			= FALSE ;
 			sms_editor_info.Callback				= (T_EDIT_CB)SmsRead_R_TEXT_editor_cb;
 			sms_editor_info.mode					= READ_ONLY_MODE;
@@ -3577,7 +3577,7 @@
 	    SEND_EVENT (l_parent, E_RETURN, l_id, NULL);
 	    SmsRead_R_TEXTEDT2_destroy(data->win);
 		break;
-		
+
 	case E_ABORT:
 	case E_EXIT:
 	    l_parent = data->parent;
@@ -3598,7 +3598,7 @@
 
  $Function:    	SmsRead_R_TEXTEDT2_win_cb
 
- $Description:	Window callback function of the SMS editor window (display of 
+ $Description:	Window callback function of the SMS editor window (display of
  				the text of one SMS).
 
  $Returns:		execution status
@@ -3606,7 +3606,7 @@
  $Arguments:	w - mfw window handle
  				e - event id
  				value - unique id
- 				parameter - optional data. 
+ 				parameter - optional data.
 *******************************************************************************/
 
 static int SmsRead_R_TEXTEDT2_win_cb (MfwEvt e, MfwWin *w)
@@ -3632,9 +3632,9 @@
  $Function:    	SmsRead_R_TEXTEDT2_smslist_cb
 
  $Description:	Callback function of the SMS editor window (editor itself).
- 
+
  $Returns:		none
- 
+
  $Arguments:	Parent - parent window.
  				ListData - Menu item list
 *******************************************************************************/
@@ -3642,8 +3642,8 @@
 void SmsRead_R_TEXTEDT2_smslist_cb(T_MFW_HND * Parent, ListMenuData * ListData)
 {
     T_MFW_WIN       * win_data = ((T_MFW_HDR *)Parent)->data;
-    T_SMSREAD_R * data     = (T_SMSREAD_R *)win_data->user;    
-	  
+    T_SMSREAD_R * data     = (T_SMSREAD_R *)win_data->user;
+
 	T_MFW_HND      * l_parent;
     SHORT            l_id;
 
@@ -3666,9 +3666,9 @@
 			 	or to the voice mailbox or to the SMS center
 			 	BE CAREFUL it allocates memory for the name, that has to be freed by the caller
 			 	It returns the length of the associated name if found, else length is 0 and name is NULL
-			 
+
  $Returns:		string length
- 
+
  $Arguments:	name - string
  				sms_addr - phonenumber string.
 *******************************************************************************/
@@ -3684,7 +3684,7 @@
 	// TBD: add international numbers management
 
 	// Voice, fax... mailboxes data
-	
+
 //	USHORT max_rcd;  // RAVI
 	char mail_number[PHB_MAX_LEN + 1];
 	char mail_alpha[10]; // size hard coded in pcm.h
@@ -3693,7 +3693,7 @@
 	name = NULL;
 
 	// First: look in phonebook
-	
+
 	if (bookFindNameInPhonebook((const char*)&sms_addr.number[0], (T_MFW_PHB_ENTRY*)&pb_entry))
 	{
 		// A name has been found
@@ -3709,19 +3709,19 @@
 		#endif
 		}
 	}
-	
+
 	// Then the different mailboxes (voice, fax, data...)
 	for (i = MFW_MB_LINE1; i <= MFW_MB_DATA; i++)
 	{
 
 		{
 			cmhPHB_getAdrStr(mail_number, PHB_MAX_LEN - 1, FFS_flashData.mbn_Num, FFS_flashData.mbn_len);
-			
+
 			if (strcmp(sms_addr.number, mail_number) EQ 0)
 			{
 				// If the same number then we get the alpha identifier
 				cmhPHB_getMfwTagNt ( FFS_flashData.mbn_AlphId, 10, (UBYTE*)mail_alpha, &nlen );
-				mail_alpha[nlen] = '\0';    
+				mail_alpha[nlen] = '\0';
 
 				if ((name = (char*)ALLOC_MEMORY(strlen(mail_alpha) + 1)) != NULL)
 				{
@@ -3746,9 +3746,9 @@
  $Function:    	SmsRead_R_TEXTEDT2_editor_cb
 
  $Description:  Callback function for the  text editor.
-			 
+
  $Returns:		void
- 
+
  $Arguments:	win - current window.
  				Identifier - unique id
  				Reason - event id
@@ -3779,37 +3779,37 @@
  $Function:    	SmsRead_FindNextNumber_cb
 
  $Description:	Exec callback function for searching the SMS text message.
- 
+
  $Returns:		none
 
  $Arguments:	win - window handler
  				event - mfw event
  				value -optional id
  				parameter - optional data.
- 
+
 *******************************************************************************/
 void SmsRead_FindNextNumber_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason)
 {
-    
+
 	T_MFW_PHB_ENTRY  pb_data;
 
 	switch (Reason)
 	{
 	case INFO_KCD_RIGHT:
 	case INFO_KCD_CLEAR:
-	
+
 		break;
 	case INFO_KCD_LEFT:
-		
+
 		// Check for numbers in SMS text, check for '+' .
 
 		if(Search_forNextNumber(&SmsData))
 		{
-			
+
 			if (bookFindNameInPhonebook((const char*)&SmsData.NumberBuffer[0], &pb_data) )
 			{
 				//Display the tag and number dialog.
-#ifdef NO_ASCIIZ			
+#ifdef NO_ASCIIZ
 	/* SPR888 - SH - parent_data->parent changed to win */
 				smsRead_NumberName_info_screen(win,(void *)&SmsData, (char*)pb_data.name.data);
 #else
@@ -3821,19 +3821,19 @@
 			{
 				/* SPR888 - SH - parent_data->parent changed to win */
 				smsRead_NumberName_info_screen(win,(void *)&SmsData,NULL);
-			}			
+			}
 		}
 		break;
 	case INFO_KCD_OFFHOOK:
-		callNumber(SmsData.NumberBuffer); 
+		callNumber(SmsData.NumberBuffer);
 		break;
-		
+
 	default:
 			TRACE_EVENT(" >>> INFO Default   ");
 		//return MFW_EVENT_REJECTED;
 		break;
 	}
-	
+
 }
 
 /*******************************************************************************
@@ -3841,9 +3841,9 @@
  $Function:    	smsRead_NumberName_info_screen
 
  $Description:    Display the number and name of numbers found in the received SMS text.
-			 
+
  $Returns:		window handle
- 
+
  $Arguments:	win - current window.
  				UserData - Sms data info
 *******************************************************************************/
@@ -3853,7 +3853,7 @@
 
 	T_DISPLAY_DATA DisplayInfo;
 	TRACE_FUNCTION("smsRead_NumberName_info_screen() ");
-	
+
 	dlg_initDisplayData_TextStr( &DisplayInfo, TxtSoftNext, TxtSoftBack, nameTag,  (char*)UserData->NumberBuffer, COLOUR_STATUS);
 	dlg_initDisplayData_events( &DisplayInfo, (T_VOID_FUNC)SmsRead_FindNextNumber_cb, FOREVER, KEY_ALL );
 
@@ -3866,11 +3866,11 @@
 
  $Function:    	Search_forNextNumber
 
- $Description:    Search through the SMS text and find a telephone number, the number 
+ $Description:    Search through the SMS text and find a telephone number, the number
  				may start with the '+' prefix.
-			 
+
  $Returns:		Boolean
- 
+
  $Arguments:	UserData - SMS data info
 *******************************************************************************/
 static BOOL Search_forNextNumber(T_SmsUserData *UserData)
@@ -3878,7 +3878,7 @@
 		/* SPR888 - SH - Rewritten, old function below */
 	/* Use search_index so we can start looking where we left off last time.
 	Set to 0 in SMSRead_R_OPTExeStoreNumber */
-	
+
 	int sms_length;
 	int number_index;
 	char number_buffer[NUMBER_LENGTH*2+4];
@@ -3904,13 +3904,13 @@
 	#else /* NO_ASCIIZ */
 	sms_length = strlen(sms_buffer);
 	#endif /* NO_ASCIIZ */
-	
+
 	number_index = 0;
 	found_status = 0;
 
 	memset (number_buffer, '\0', NUMBER_LENGTH*2+4);
 
-	
+
 	while (search_index<sms_length && found_status<2 && number_index<NUMBER_LENGTH*2+4)
 	{
 		character = sms_buffer[search_index];
@@ -3946,7 +3946,7 @@
 
 	return FALSE;
 }
-	
+
 
 /* api Store number for calling when reading SMS - 04/03/2002
 */
@@ -3955,11 +3955,11 @@
 
  $Function:    	Search_forNextNumber
 
- $Description:    Search through the SMS text and find a telephone number, the number 
+ $Description:    Search through the SMS text and find a telephone number, the number
  				may start with the '+' prefix.
-			 
+
  $Returns:		Boolean
- 
+
  $Arguments:	UserData - SMS data info
 *******************************************************************************/
 void SmsRead_StoreNumber(void)
@@ -3972,7 +3972,7 @@
     T_MFW_WIN    * win_data2   =  ((T_MFW_HDR *)parent)->data;
     T_SMSREAD_R_TEXTEDT2  * parent_data =  (T_SMSREAD_R_TEXTEDT2 *)win_data2->user;
 	T_MFW_PHB_ENTRY  pb_data;
-	
+
 	TRACE_FUNCTION("SmsRead_StoreNumber");
 
 	TRACE_EVENT_P1("TON = %d",parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.ton);
@@ -3981,24 +3981,24 @@
 	{
 		if(parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number[0] == '+')
 		{
-			strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number); 
+			strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number);
 		}
 		else
 		{
 			strcpy((char *)SmsData.NumberBuffer,"+");
-			strncat((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number,sizeof(SmsData.NumberBuffer)-2); 
+			strncat((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number,sizeof(SmsData.NumberBuffer)-2);
 		}
 	}
 	else
 	{
-	
+
 		TRACE_EVENT_P1("Number = %s",parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number);
-		strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number); 
+		strcpy((char *)SmsData.NumberBuffer,(char *)parent_data->sms_editor_data->sms_info->sms_mt.orig_addr.number);
 	}
 	/* Marcus: Issue 1489: 13/12/2002: End */
 	/*MC, unicode support*/
 	/* x0039928 - Lint warning fix */
-	memcpy((char*)pb_data.number, (char*)SmsData.NumberBuffer, sizeof(SmsData.NumberBuffer)); 
+	memcpy((char*)pb_data.number, (char*)SmsData.NumberBuffer, sizeof(SmsData.NumberBuffer));
 
 
 	    SmsRead_R_TEXTEDT2_destroy(message_win);
@@ -4017,18 +4017,18 @@
 		}
 
 	callNumber(pb_data.number);
-	
+
 }
 
-//x0035544 Mar 23, 2006 DR:OMAPS00047813 
+//x0035544 Mar 23, 2006 DR:OMAPS00047813
 /*******************************************************************************
 
  $Function:    	Search_forNumberInSMS
 
  $Description:    Search through the SMS text and find the numbers
-			 
+
  $Returns:		void
- 
+
  $Arguments:	UserData - SMS data info
 *******************************************************************************/
 void Search_forNumberInSMS(T_SmsUserData *UserData)
@@ -4037,13 +4037,13 @@
   int len, sms_length = 0;
   char character;
   char *sms_buffer, *sender_num;
-  BOOL mesg_end=FALSE;  
-    
+  BOOL mesg_end=FALSE;
+
   TRACE_FUNCTION("Search_forNumberInSMS()");
 
   sms_buffer = (char*)UserData->TextBuffer;
   sender_num = (char*)UserData->NumberBuffer;
-  
+
 #ifdef NO_ASCIIZ
   if (sms_buffer[0] == (char)0x80)
   {
@@ -4062,61 +4062,61 @@
 #endif /* NO_ASCIIZ */
   sms_length--;
   len= num_row=num_col=0;
-  smsread_num_ctr =0;  
+  smsread_num_ctr =0;
   num_buffer = (char**)ALLOC_MEMORY(sizeof(char*)*MAX_NUMBER_SIZE);
   if (num_buffer == NULL)
-	{	
+	{
 		TRACE_EVENT("sms number list alloc failed");
 		return;
 	}
-  
+
   for(i=0; i<MAX_NUMBER_SIZE; i++)
   	num_buffer[i] = (char*)ALLOC_MEMORY(sizeof(char)*NUMBER_LENGTH);
 		if (num_buffer[i] == NULL)
-		{	
+		{
 			TRACE_EVENT(" sms number string alloc failed");
-			return; 
+			return;
 		}
-  
-      
+
+
     while (len <= sms_length)
   {
     character = sms_buffer[len];
-	
+
 	if(len == sms_length)
 	 {
 	    mesg_end = TRUE;
   	 }
-	
+
 #ifdef NO_ASCIIZ
 		if (character=='+' ||  ( character>='0' && character<='9' ) || (character==0))
 #else
 		if (character=='+' ||  ( character>='0' && character<='9' ) )
 #endif
-    {	
+    {
       if (character != 0) /*MC, only copy non-Null chars*/
-      {      
+      {
       if(num_col <= NUMBER_LENGTH)
       	{
-         	num_buffer[num_row][num_col] = character;		
+         	num_buffer[num_row][num_col] = character;
         	num_col++;
       	}
 		if(mesg_end && (strlen(num_buffer[num_row]) >= MIN_NUM_LENGTH))//copy if number is at end of the message
-		 {			 	
+		 {
 			smsread_num_ctr++;
 			num_row++;
-		 }		
+		 }
       }
     }
     else
     {
       if(num_col != 0 )
       {
-        num_buffer[num_row][num_col] = '\0';		
+        num_buffer[num_row][num_col] = '\0';
         if(strlen(num_buffer[num_row]) < MIN_NUM_LENGTH )
         {
           num_col=0;
-        }  
+        }
         else
         {
           smsread_num_ctr++;
@@ -4128,14 +4128,14 @@
       }
     }
 	len++;
-  } 	
-		
+  }
+
   if( num_row < 10 )//copy the sender number
    {
     	memcpy((char*)num_buffer[num_row], (char*)sender_num, NUMBER_LENGTH);
 	smsread_num_ctr++;
    }
-   
+
   return ;
 }
 
@@ -4146,13 +4146,13 @@
 
  $Description: Window event handler
 
- $Returns:	MFW_EVENT_REJECTED: 
+ $Returns:	MFW_EVENT_REJECTED:
  			MFW_EVENT_CONSUMED:
 
- $Arguments:	
+ $Arguments:
 
 *******************************************************************************/
-static int smsread_numlist_win_cb (MfwEvt e, MfwWin *w)    
+static int smsread_numlist_win_cb (MfwEvt e, MfwWin *w)
 {
   	TRACE_FUNCTION ("smsread_numlist_win_cb()");
   	switch (e)
@@ -4184,25 +4184,25 @@
 {
   T_SMSREAD_R *  data = (T_SMSREAD_R *)mfwAlloc(sizeof (T_SMSREAD_R));
   T_MFW_WIN  * win;
-  
+
   TRACE_FUNCTION ("SmsRead_BuildNumList_Menu");
-  
+
   /*
   	* Create window handler
   	*/
-  
+
   data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)smsread_numlist_win_cb);
   if (data->win EQ NULL)
   {
   FREE_MEMORY( (void *)data, sizeof( T_SMSREAD_R ) );
-  		return NULL; 
+  		return NULL;
   }
-  
+
   TRACE_EVENT("list holder window created: " );
   /*
   	* connect the dialog data to the MFW-window
   	*/
-  
+
   data->mmi_control.dialog = (T_DIALOG_FUNC)smsread_numlist_exec_cb;
   data->mmi_control.data   = data;
   win                      = ((T_MFW_HDR *)data->win)->data;
@@ -4212,7 +4212,7 @@
   /*
   	* return window handle
   	*/
-  
+
   	return data->win;
 }
 
@@ -4231,28 +4231,28 @@
 void smsread_numlist_exec_cb (T_MFW_HND win, USHORT event)
 {
   T_MFW_WIN       * win_data;
-  T_SMSREAD_R * data;    
+  T_SMSREAD_R * data;
 
   /* List is complete so present menu. */
   USHORT i;
-  
+
   TRACE_FUNCTION("smsread_numlist_exec_cb");
- 
-		
-  win_data = ((T_MFW_HDR *) win)->data; 
+
+
+  win_data = ((T_MFW_HDR *) win)->data;
   data = (T_SMSREAD_R *)win_data->user;
 
  switch (event)
 	{
-	case E_INIT:				
+	case E_INIT:
   data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData));
-  
+
   if(data->menu_list_data == 0)
   {
     TRACE_EVENT("Failed memory alloc 1 ");
     return;
   }
-  /*SPR 2686, only allocate memory for the number of messages displayed*/	
+  /*SPR 2686, only allocate memory for the number of messages displayed*/
   data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( smsread_num_ctr * sizeof(T_MFW_MNU_ITEM) );//JVJE
 
   if(data->menu_list_data->List == 0)
@@ -4260,15 +4260,15 @@
     TRACE_EVENT("Failed memory alloc 2");
     return;
   }
-  
+
   for (i = 0; i < smsread_num_ctr; i++)
   {
     mnuInitDataItem(&data->menu_list_data->List[i]);
     data->menu_list_data->List[i].str  = (char *)num_buffer[i];
     TRACE_EVENT_P1("Menu Tags:%s", data->menu_list_data->List[i].str);
-    data->menu_list_data->List[i].flagFunc = item_flag_none; 
-  } 	
-	
+    data->menu_list_data->List[i].flagFunc = item_flag_none;
+  }
+
   data->menu_list_data->ListLength =smsread_num_ctr;
   data->menu_list_data->ListPosition = 1;
   data->menu_list_data->CursorPosition = 1;
@@ -4280,20 +4280,20 @@
     data->menu_list_data->RightSoftKey = TxtNull;
   else
     data->menu_list_data->RightSoftKey = TxtSoftBack;
-  	
+
   data->menu_list_data->KeyEvents = KEY_ALL;
   data->menu_list_data->Reason = 0;
   data->menu_list_data->Strings = TRUE;
   data->menu_list_data->Attr   = (MfwMnuAttr*)&menuSearchNumListAttr;
-  data->menu_list_data->autoDestroy    = FALSE;  
- 	
+  data->menu_list_data->autoDestroy    = FALSE;
+
   /* Create the dynamic menu window */
   listDisplayListMenu(win, data->menu_list_data, (ListCbFunc_t)SmsRead_numlist_cb ,0);
   break;
   default:
   	break;
  	}
-  
+
   }
 
 //Mar 23, 2006 DR:OMAPS00047813 x0035544
@@ -4331,35 +4331,35 @@
 		** Free the memory set aside for ALL the devices to be listed.
 		*/
 		for(i=0; i<MAX_NUMBER_SIZE;i++)
-  		 {  
+  		 {
   			FREE_MEMORY((U8*)num_buffer[i], sizeof(char)*NUMBER_LENGTH);
-			num_buffer[i] = NULL;  		 	
+			num_buffer[i] = NULL;
 		 }
-	
+
 		/*deallocate memory for the array of pointer to numbers*/
   			FREE_MEMORY((U8*)num_buffer, sizeof(char*)*MAX_NUMBER_SIZE);
-	
+
 		if (data->menu_list_data->List != NULL)
 			{
-			FREE_MEMORY ((void *)data->menu_list_data->List, (U16)((data->menu_list_data->ListLength) * 
+			FREE_MEMORY ((void *)data->menu_list_data->List, (U16)((data->menu_list_data->ListLength) *
 						sizeof(T_MFW_MNU_ITEM)));
 			}
 		if (data->menu_list_data != NULL)
 			{
 			FREE_MEMORY ((void *)data->menu_list_data, sizeof (ListMenuData));
 			}
-	 	
+
 		SmsRead_numlist_destroy(data->win);
-		
-		
+
+
 
 	}
-	 
+
 	else if(ListData->Reason EQ LISTS_REASON_SELECT)
-	  {			
-		pb_number = ListData->List[ListData->ListPosition].str;		
-		callNumber((UBYTE*)pb_number);		
-		
+	  {
+		pb_number = ListData->List[ListData->ListPosition].str;
+		callNumber((UBYTE*)pb_number);
+
 	  }
 
 	return;
@@ -4371,11 +4371,11 @@
  $Function:    	SmsRead_numlist_destroy
 
  $Description:	Destroy the Extr Number window.
- 
+
  $Returns:		none
 
  $Arguments:	own_window - window handler
- 
+
 *******************************************************************************/
 
 static void SmsRead_numlist_destroy(MfwHnd own_window)
@@ -4393,7 +4393,7 @@
 	if (data)
 	{
 		win_delete(data->win);
-		
+
 		/*
 		** Free Memory
 		*/