Bug 1399756 - remove trailing spaces in mailnews/mapi. rs=white-space-only
authorJorg K
Mon, 18 Dec 2017 23:27:44 +0100
changeset 30619 8c5ae32e395e84c2d9c682679df2e2d2ebfabdf5
parent 30618 c05fa00a2d5fcf9237e904f98411ae5b6740004a
child 30620 12a18e736fca9a9ac8e0866caf470fa9342af842
push id382
push userclokep@gmail.com
push dateMon, 12 Mar 2018 19:05:34 +0000
reviewerswhite-space-only
bugs1399756
Bug 1399756 - remove trailing spaces in mailnews/mapi. rs=white-space-only
mailnews/mapi/mapiDll/MapiDll.cpp
mailnews/mapi/mapihook/src/Registry.cpp
mailnews/mapi/mapihook/src/Registry.h
mailnews/mapi/mapihook/src/msgMapiFactory.cpp
mailnews/mapi/mapihook/src/msgMapiHook.h
mailnews/mapi/mapihook/src/msgMapiImp.cpp
mailnews/mapi/mapihook/src/msgMapiImp.h
mailnews/mapi/mapihook/src/msgMapiMain.cpp
mailnews/mapi/mapihook/src/msgMapiMain.h
mailnews/mapi/mapihook/src/msgMapiSupport.cpp
--- a/mailnews/mapi/mapiDll/MapiDll.cpp
+++ b/mailnews/mapi/mapiDll/MapiDll.cpp
@@ -23,34 +23,34 @@ const CLSID CLSID_CMapiImp = {0x29f458be
                               {0xa3, 0xdd, 0x0, 0xb0, 0xd0, 0xf3, 0xba, 0xa7}};
 const IID IID_nsIMapi = {0x6EDCD38E,0x8861,0x11d5,
                         {0xA3,0xDD,0x00,0xB0,0xD0,0xF3,0xBA,0xA7}};
 
 DWORD tId = 0;
 
 #define   MAPI_MESSAGE_TYPE     0
 #define   MAPI_RECIPIENT_TYPE   1
- 
+
 typedef struct {
   LPVOID    lpMem;
   UCHAR     memType;
 } memTrackerType;
 
 
 // this can't be right.
 memTrackerType    memArray[MAX_POINTERS];
 
 //
 // For remembering memory...how ironic.
 //
 void
 SetPointerArray(LPVOID ptr, BYTE type)
 {
 int i;
-  
+
   for (i=0; i<MAX_POINTERS; i++)
   {
     if (memArray[i].lpMem == NULL)
     {
       memArray[i].lpMem = ptr;
       memArray[i].memType = type;
       break;
     }
@@ -195,28 +195,28 @@ ULONG FAR PASCAL MAPISendMail (LHANDLE l
     if ( (!(flFlags & MAPI_DIALOG)) && (lpMessage->lpRecips == NULL) )
         return MAPI_E_UNKNOWN_RECIPIENT ;
 
     if (!lhSession || pNsMapi->IsValidSession(lhSession) != S_OK)
     {
         FLAGS LoginFlag ;
         if ( (flFlags & MAPI_LOGON_UI) && (flFlags & MAPI_NEW_SESSION) )
             LoginFlag = MAPI_LOGON_UI | MAPI_NEW_SESSION ;
-        else if (flFlags & MAPI_LOGON_UI) 
+        else if (flFlags & MAPI_LOGON_UI)
             LoginFlag = MAPI_LOGON_UI ;
 
         hr = MAPILogon (ulUIParam, (LPTSTR) NULL, (LPTSTR) NULL, LoginFlag, 0, &lhSession) ;
         if (hr != SUCCESS_SUCCESS)
             return MAPI_E_LOGIN_FAILURE ;
         bTempSession = TRUE ;
     }
 
     // we need to deal with null data passed in by MAPI clients, specially when MAPI_DIALOG is set.
     // The MS COM type lib code generated by MIDL for the MS COM interfaces checks for these parameters
-    // to be non null, although null is a valid value for them here. 
+    // to be non null, although null is a valid value for them here.
     nsMapiRecipDesc * lpRecips ;
     nsMapiFileDesc * lpFiles ;
 
     nsMapiMessage Message ;
     memset (&Message, 0, sizeof (nsMapiMessage) ) ;
     nsMapiRecipDesc Recipient ;
     memset (&Recipient, 0, sizeof (nsMapiRecipDesc) );
     nsMapiFileDesc Files ;
@@ -234,30 +234,30 @@ ULONG FAR PASCAL MAPISendMail (LHANDLE l
         lpRecips = lpMessage->lpRecips ;
     if(!lpMessage->lpFiles)
     {
         lpFiles = &Files ;
     }
     else
         lpFiles = lpMessage->lpFiles ;
 
-    hr = pNsMapi->SendMail (lhSession, lpMessage, 
+    hr = pNsMapi->SendMail (lhSession, lpMessage,
                             (short) lpMessage->nRecipCount, lpRecips,
                             (short) lpMessage->nFileCount, lpFiles,
                             flFlags, ulReserved);
 
     // we are seeing a problem when using Word, although we return success from the MAPI support
     // MS COM interface in mozilla, we are getting this error here. This is a temporary hack !!
     if (hr == 0x800703e6)
         hr = SUCCESS_SUCCESS;
-    
+
     if (bTempSession)
         MAPILogoff (lhSession, ulUIParam, 0,0) ;
 
-    return hr ; 
+    return hr ;
 }
 
 
 ULONG FAR PASCAL MAPISendDocuments(ULONG ulUIParam, LPTSTR lpszDelimChar, LPTSTR lpszFilePaths,
                                 LPTSTR lpszFileNames, ULONG ulReserved)
 {
     LHANDLE lhSession ;
     nsIMapi *pNsMapi = NULL;
@@ -266,17 +266,17 @@ ULONG FAR PASCAL MAPISendDocuments(ULONG
         return MAPI_E_FAILURE;
 
     unsigned long result = MAPILogon (ulUIParam, (LPTSTR) NULL, (LPTSTR) NULL, MAPI_LOGON_UI, 0, &lhSession) ;
     if (result != SUCCESS_SUCCESS)
         return MAPI_E_LOGIN_FAILURE ;
 
     HRESULT hr;
 
-    hr = pNsMapi->SendDocuments(lhSession, (LPTSTR) lpszDelimChar, (LPTSTR) lpszFilePaths, 
+    hr = pNsMapi->SendDocuments(lhSession, (LPTSTR) lpszDelimChar, (LPTSTR) lpszFilePaths,
                                     (LPTSTR) lpszFileNames, ulReserved) ;
 
     MAPILogoff (lhSession, ulUIParam, 0,0) ;
 
     return hr ;
 }
 
 ULONG FAR PASCAL MAPIFindNext(LHANDLE lhSession, ULONG ulUIParam, LPTSTR lpszMessageType,
--- a/mailnews/mapi/mapihook/src/Registry.cpp
+++ b/mailnews/mapi/mapihook/src/Registry.cpp
@@ -53,26 +53,26 @@ BOOL setKeyAndValue(nsAutoCString keyNam
     nsAutoCString theKey(keyName);
     if (subKey != NULL)
     {
         theKey += "\\";
         theKey += subKey;
     }
 
     // Create and open key and subkey.
-    long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT, theKey.get(), 
+    long lResult = RegCreateKeyEx(HKEY_CLASSES_ROOT, theKey.get(),
                                   0, NULL, REG_OPTION_NON_VOLATILE,
                                   KEY_ALL_ACCESS, NULL, &hKey, NULL);
     if (lResult != ERROR_SUCCESS)
         return FALSE ;
 
     // Set the Value.
     if (theValue != NULL)
     {
-       lResult = RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE *)theValue, 
+       lResult = RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE *)theValue,
                       strlen(theValue)+1);
        if (lResult != ERROR_SUCCESS)
            retValue = FALSE;
     }
 
     RegCloseKey(hKey);
     return TRUE;
 }
@@ -229,25 +229,25 @@ HRESULT RegisterServer(const CLSID& clsi
         return S_FALSE;
 
     // Add the version-independent ProgID subkey under CLSID key.
     if (!setKeyAndValue(registryKey, "VersionIndependentProgID", szVerIndProgID))
         return S_FALSE;
 
     // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT.
     if (!setKeyAndValue(independentProgId, NULL, szFriendlyName))
-        return S_FALSE; 
+        return S_FALSE;
     if (!setKeyAndValue(independentProgId, "CLSID", szCLSID))
         return S_FALSE;
     if (!setKeyAndValue(independentProgId, "CurVer", szProgID))
         return S_FALSE;
 
     // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT.
     if (!setKeyAndValue(progId, NULL, szFriendlyName))
-        return S_FALSE; 
+        return S_FALSE;
     if (!setKeyAndValue(progId, "CLSID", szCLSID))
         return S_FALSE;
 
     RegisterProxy();
 
     return S_OK;
 }
 
--- a/mailnews/mapi/mapihook/src/Registry.h
+++ b/mailnews/mapi/mapihook/src/Registry.h
@@ -4,17 +4,17 @@
 
 #ifndef _REGISTRY_H_
 #define _REGISTRY_H_
 
 #include <objbase.h>
 
 // This function will register a component in the Registry.
 
-HRESULT RegisterServer(const CLSID& clsid, 
+HRESULT RegisterServer(const CLSID& clsid,
                        const char* szFriendlyName,
                        const char* szVerIndProgID,
                        const char* szProgID) ;
 
 // This function will unregister a component.
 
 HRESULT UnregisterServer(const CLSID& clsid,
                          const char* szVerIndProgID,
--- a/mailnews/mapi/mapihook/src/msgMapiFactory.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiFactory.cpp
@@ -14,50 +14,50 @@ CMapiFactory ::CMapiFactory()
 {
 }
 
 CMapiFactory::~CMapiFactory()
 {
 }
 
 STDMETHODIMP CMapiFactory::QueryInterface(const IID& aIid, void** aPpv)
-{    
+{
     if ((aIid == IID_IUnknown) || (aIid == IID_IClassFactory))
     {
-        *aPpv = static_cast<IClassFactory*>(this); 
+        *aPpv = static_cast<IClassFactory*>(this);
     }
     else
     {
         *aPpv = nullptr;
         return E_NOINTERFACE;
     }
     reinterpret_cast<IUnknown*>(*aPpv)->AddRef();
     return S_OK;
 }
 
 STDMETHODIMP_(ULONG) CMapiFactory::AddRef()
 {
     return ++m_cRef;
 }
 
-STDMETHODIMP_(ULONG) CMapiFactory::Release() 
+STDMETHODIMP_(ULONG) CMapiFactory::Release()
 {
     int32_t temp = --m_cRef;
     if (m_cRef == 0)
     {
         delete this;
         return 0;
     }
 
     return temp;
 }
 
 STDMETHODIMP CMapiFactory::CreateInstance(IUnknown* aUnknownOuter,
                                            const IID& aIid,
-                                           void** aPpv) 
+                                           void** aPpv)
 {
     // Cannot aggregate.
 
     if (aUnknownOuter != nullptr)
     {
         return CLASS_E_NOAGGREGATION ;
     }
 
@@ -74,12 +74,12 @@ STDMETHODIMP CMapiFactory::CreateInstanc
 
     // Release the IUnknown pointer.
     // (If QueryInterface failed, component will delete itself.)
 
     pImp->Release();
     return hr;
 }
 
-STDMETHODIMP CMapiFactory::LockServer(BOOL aLock) 
+STDMETHODIMP CMapiFactory::LockServer(BOOL aLock)
 {
     return S_OK ;
 }
--- a/mailnews/mapi/mapihook/src/msgMapiHook.h
+++ b/mailnews/mapi/mapihook/src/msgMapiHook.h
@@ -6,28 +6,28 @@
 #define MSG_MAPI_HOOK_H_
 
 #include "prtypes.h"
 
 class nsMapiHook
 {
     public :
 
-        static bool DisplayLoginDialog(bool aLogin, char16_t **aUsername, 
+        static bool DisplayLoginDialog(bool aLogin, char16_t **aUsername,
                         char16_t **aPassword);
         static bool VerifyUserName(const nsString& aUsername, nsCString& aIdKey);
 
         static bool IsBlindSendAllowed () ;
         static nsresult BlindSendMail (unsigned long aSession, nsIMsgCompFields * aCompFields) ;
         static nsresult ShowComposerWindow (unsigned long aSession, nsIMsgCompFields * aCompFields) ;
         static nsresult PopulateCompFields(lpnsMapiMessage aMessage, nsIMsgCompFields * aCompFields) ;
-        static nsresult PopulateCompFieldsWithConversion(lpnsMapiMessage aMessage, 
+        static nsresult PopulateCompFieldsWithConversion(lpnsMapiMessage aMessage,
                                         nsIMsgCompFields * aCompFields) ;
-        static nsresult PopulateCompFieldsForSendDocs(nsIMsgCompFields * aCompFields, 
+        static nsresult PopulateCompFieldsForSendDocs(nsIMsgCompFields * aCompFields,
                                         ULONG aFlags, LPTSTR aDelimChar, LPTSTR aFilePaths) ;
-        static nsresult HandleAttachments (nsIMsgCompFields * aCompFields, int32_t aFileCount, 
+        static nsresult HandleAttachments (nsIMsgCompFields * aCompFields, int32_t aFileCount,
                                         lpnsMapiFileDesc aFiles, BOOL aIsUnicode) ;
         static void CleanUp();
 
         static bool isMapiService;
 };
 
 #endif  // MSG_MAPI_HOOK_H_
--- a/mailnews/mapi/mapihook/src/msgMapiImp.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiImp.cpp
@@ -39,27 +39,27 @@ using namespace mozilla::mailnews;
 mozilla::LazyLogModule MAPI("MAPI");
 
 CMapiImp::CMapiImp()
 : m_cRef(1)
 {
     m_Lock = PR_NewLock();
 }
 
-CMapiImp::~CMapiImp() 
-{ 
+CMapiImp::~CMapiImp()
+{
     if (m_Lock)
         PR_DestroyLock(m_Lock);
 }
 
 STDMETHODIMP CMapiImp::QueryInterface(const IID& aIid, void** aPpv)
-{    
+{
     if (aIid == IID_IUnknown)
     {
-        *aPpv = static_cast<nsIMapi*>(this); 
+        *aPpv = static_cast<nsIMapi*>(this);
     }
     else if (aIid == IID_nsIMapi)
     {
         *aPpv = static_cast<nsIMapi*>(this);
     }
     else
     {
         *aPpv = nullptr;
@@ -70,17 +70,17 @@ STDMETHODIMP CMapiImp::QueryInterface(co
     return S_OK;
 }
 
 STDMETHODIMP_(ULONG) CMapiImp::AddRef()
 {
     return ++m_cRef;
 }
 
-STDMETHODIMP_(ULONG) CMapiImp::Release() 
+STDMETHODIMP_(ULONG) CMapiImp::Release()
 {
     int32_t temp = --m_cRef;
     if (m_cRef == 0)
     {
         delete this;
         return 0;
     }
 
@@ -142,18 +142,18 @@ STDMETHODIMP CMapiImp::Login(unsigned lo
             NS_ASSERTION(false, "failed verifying user name");
             return hr;
         }
     }
     else
     {
       // get default account
       nsresult rv;
-      nsCOMPtr <nsIMsgAccountManager> accountManager = 
-        do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv); 
+      nsCOMPtr <nsIMsgAccountManager> accountManager =
+        do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv,MAPI_E_LOGIN_FAILURE);
       nsCOMPtr <nsIMsgAccount> account;
       nsCOMPtr <nsIMsgIdentity> identity;
       rv = accountManager->GetDefaultAccount(getter_AddRefs(account));
       NS_ENSURE_SUCCESS(rv,MAPI_E_LOGIN_FAILURE);
       rv = account->GetDefaultIdentity(getter_AddRefs(identity));
       NS_ENSURE_SUCCESS(rv,MAPI_E_LOGIN_FAILURE);
       if (!identity)
@@ -189,52 +189,52 @@ STDMETHODIMP CMapiImp::Login(unsigned lo
             break;
         }
     }
 
     return S_OK;
 }
 
 STDMETHODIMP CMapiImp::SendMail( unsigned long aSession, lpnsMapiMessage aMessage,
-     short aRecipCount, lpnsMapiRecipDesc aRecips , short aFileCount, lpnsMapiFileDesc aFiles , 
+     short aRecipCount, lpnsMapiRecipDesc aRecips , short aFileCount, lpnsMapiFileDesc aFiles ,
      unsigned long aFlags, unsigned long aReserved)
 {
     nsresult rv = NS_OK ;
 
     MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("CMapiImp::SendMail using flags %d\n", aFlags));
     // Assign the pointers in the aMessage struct to the array of Recips and Files
-    // received here from MS COM. These are used in BlindSendMail and ShowCompWin fns 
+    // received here from MS COM. These are used in BlindSendMail and ShowCompWin fns
     aMessage->lpRecips = aRecips ;
     aMessage->lpFiles = aFiles ;
 
-    MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("CMapiImp::SendMail flags=%x subject: %s sender: %s\n", 
+    MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("CMapiImp::SendMail flags=%x subject: %s sender: %s\n",
       aFlags, (char *) aMessage->lpszSubject, (aMessage->lpOriginator) ? aMessage->lpOriginator->lpszAddress : ""));
 
     /** create nsIMsgCompFields obj and populate it **/
     nsCOMPtr<nsIMsgCompFields> pCompFields = do_CreateInstance(NS_MSGCOMPFIELDS_CONTRACTID, &rv) ;
     if (NS_FAILED(rv) || (!pCompFields) ) return MAPI_E_INSUFFICIENT_MEMORY ;
 
     if (aFlags & MAPI_UNICODE)
         rv = nsMapiHook::PopulateCompFields(aMessage, pCompFields) ;
     else
         rv = nsMapiHook::PopulateCompFieldsWithConversion(aMessage, pCompFields) ;
-    
+
     if (NS_SUCCEEDED (rv))
     {
         // see flag to see if UI needs to be brought up
         if (!(aFlags & MAPI_DIALOG))
         {
             rv = nsMapiHook::BlindSendMail(aSession, pCompFields);
         }
         else
         {
             rv = nsMapiHook::ShowComposerWindow(aSession, pCompFields);
         }
     }
-    
+
     return nsMAPIConfiguration::GetMAPIErrorFromNSError (rv) ;
 }
 
 
 STDMETHODIMP CMapiImp::SendDocuments( unsigned long aSession, LPTSTR aDelimChar,
                             LPTSTR aFilePaths, LPTSTR aFileNames, ULONG aFlags)
 {
     nsresult rv = NS_OK ;
@@ -244,30 +244,30 @@ STDMETHODIMP CMapiImp::SendDocuments( un
     nsCOMPtr<nsIMsgCompFields> pCompFields = do_CreateInstance(NS_MSGCOMPFIELDS_CONTRACTID, &rv) ;
     if (NS_FAILED(rv) || (!pCompFields) ) return MAPI_E_INSUFFICIENT_MEMORY ;
 
     if (aFilePaths)
     {
         rv = nsMapiHook::PopulateCompFieldsForSendDocs(pCompFields, aFlags, aDelimChar, aFilePaths) ;
     }
 
-    if (NS_SUCCEEDED (rv)) 
+    if (NS_SUCCEEDED (rv))
         rv = nsMapiHook::ShowComposerWindow(aSession, pCompFields);
     else
       MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("CMapiImp::SendDocument error rv = %lx, paths = %s names = %s\n", rv, aFilePaths, aFileNames));
 
     return nsMAPIConfiguration::GetMAPIErrorFromNSError (rv) ;
 }
 
 nsresult CMapiImp::GetDefaultInbox(nsIMsgFolder **inboxFolder)
 {
   // get default account
   nsresult rv;
-  nsCOMPtr <nsIMsgAccountManager> accountManager = 
-    do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv); 
+  nsCOMPtr <nsIMsgAccountManager> accountManager =
+    do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCOMPtr <nsIMsgAccount> account;
   rv = accountManager->GetDefaultAccount(getter_AddRefs(account));
   NS_ENSURE_SUCCESS(rv,rv);
 
   // get incoming server
   nsCOMPtr <nsIMsgIncomingServer> server;
@@ -280,54 +280,54 @@ nsresult CMapiImp::GetDefaultInbox(nsIMs
 
   // we only care about imap and pop3
   if (type.EqualsLiteral("imap") || type.EqualsLiteral("pop3"))
   {
     // imap and pop3 account should have an Inbox
     nsCOMPtr<nsIMsgFolder> rootMsgFolder;
     rv = server->GetRootMsgFolder(getter_AddRefs(rootMsgFolder));
     NS_ENSURE_SUCCESS(rv,rv);
- 
+
     if (!rootMsgFolder)
       return NS_ERROR_FAILURE;
- 
+
     rootMsgFolder->GetFolderWithFlags(nsMsgFolderFlags::Inbox, inboxFolder);
     if (!*inboxFolder)
      return NS_ERROR_FAILURE;
- 
+
   }
   return NS_OK;
 }
 
 //*****************************************************************************
 // Encapsulate the XP DB stuff required to enumerate messages
 
-class MsgMapiListContext 
+class MsgMapiListContext
 {
 public:
   MsgMapiListContext () {}
   ~MsgMapiListContext ();
-  
+
   nsresult OpenDatabase (nsIMsgFolder *folder);
-  
+
   nsMsgKey GetNext ();
   nsresult MarkRead (nsMsgKey key, bool read);
-  
+
   lpnsMapiMessage GetMessage (nsMsgKey, unsigned long flFlags);
   bool IsIMAPHost(void);
   bool DeleteMessage(nsMsgKey key);
-  
+
 protected:
-  
+
   char *ConvertDateToMapiFormat (time_t);
   char *ConvertBodyToMapiFormat (nsIMsgDBHdr *hdr);
   void ConvertRecipientsToMapiFormat(const nsCOMArray<msgIAddressObject> &ourRecips,
                                      lpnsMapiRecipDesc mapiRecips,
                                      int mapiRecipClass);
-  
+
   nsCOMPtr <nsIMsgFolder> m_folder;
   nsCOMPtr <nsIMsgDatabase> m_db;
   nsCOMPtr <nsISimpleEnumerator> m_msgEnumerator;
 };
 
 
 LONG CMapiImp::InitContext(unsigned long session, MsgMapiListContext **listContext)
 {
@@ -371,17 +371,17 @@ STDMETHODIMP CMapiImp::FindNext(unsigned
 {
   //
   // If this is true, then this is the first call to this FindNext function
   // and we should start the enumeration operation.
   //
 
   *lpszMessageID = '\0';
   nsMAPIConfiguration * pMapiConfig = nsMAPIConfiguration::GetMAPIConfiguration() ;
-  if (!pMapiConfig) 
+  if (!pMapiConfig)
   {
     NS_ASSERTION(false, "failed to get config in findnext");
     return MAPI_E_FAILURE ;  // get the singelton obj
   }
   MsgMapiListContext *listContext;
   LONG ret = InitContext(aSession, &listContext);
   if (ret != SUCCESS_SUCCESS)
   {
@@ -497,64 +497,64 @@ nsresult MsgMapiListContext::OpenDatabas
     m_folder = folder;
     dbErr = folder->GetMsgDatabase(getter_AddRefs(m_db));
     if (m_db)
       dbErr = m_db->EnumerateMessages(getter_AddRefs(m_msgEnumerator));
   }
   return dbErr;
 }
 
-bool 
+bool
 MsgMapiListContext::IsIMAPHost(void)
 {
-  if (!m_folder) 
+  if (!m_folder)
     return FALSE;
   nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(m_folder);
 
   return imapFolder != nullptr;
 }
 
 nsMsgKey MsgMapiListContext::GetNext ()
 {
   nsMsgKey key = nsMsgKey_None;
   bool      keepTrying = TRUE;
-  
+
 //  NS_ASSERTION (m_msgEnumerator && m_db, "need enumerator and db");
   if (m_msgEnumerator && m_db)
   {
-    
-    do 
+
+    do
     {
-      keepTrying = FALSE;  
+      keepTrying = FALSE;
       nsCOMPtr <nsISupports> hdrISupports;
       nsCOMPtr <nsIMsgDBHdr> msgHdr;
       if (NS_SUCCEEDED(m_msgEnumerator->GetNext(getter_AddRefs(hdrISupports))) && hdrISupports)
       {
         msgHdr = do_QueryInterface(hdrISupports);
         msgHdr->GetMessageKey(&key);
-        
+
         // Check here for IMAP message...if not, just return...
         if (!IsIMAPHost())
           return key;
-        
+
         // If this is an IMAP message, we have to make sure we have a valid
         // body to work with.
         uint32_t  flags = 0;
-        
+
         (void) msgHdr->GetFlags(&flags);
-        if (flags & nsMsgMessageFlags::Offline) 
+        if (flags & nsMsgMessageFlags::Offline)
           return key;
-        
+
         // Ok, if we get here, we have an IMAP message without a body!
         // We need to keep trying by calling the GetNext member recursively...
         keepTrying = TRUE;
       }
     } while (keepTrying);
   }
-  
+
   return key;
 }
 
 
 nsresult MsgMapiListContext::MarkRead (nsMsgKey key, bool read)
 {
   nsresult err = NS_ERROR_FAILURE;
   NS_ASSERTION(m_db, "no db");
@@ -578,26 +578,26 @@ lpnsMapiMessage MsgMapiListContext::GetM
     if (msgHdr)
     {
       msgHdr->GetSubject (getter_Copies(subject));
       message->lpszSubject = (char *) CoTaskMemAlloc(subject.Length() + 1);
       strcpy((char *) message->lpszSubject, subject.get());
       uint32_t date;
       (void) msgHdr->GetDateInSeconds(&date);
       message->lpszDateReceived = ConvertDateToMapiFormat (date);
-      
+
       // Pull out the flags info
       // anything to do with MAPI_SENT? Since we're only reading the Inbox, I guess not
       uint32_t ourFlags;
       (void) msgHdr->GetFlags(&ourFlags);
       if (!(ourFlags & nsMsgMessageFlags::Read))
         message->flFlags |= MAPI_UNREAD;
       if (ourFlags & (nsMsgMessageFlags::MDNReportNeeded | nsMsgMessageFlags::MDNReportSent))
         message->flFlags |= MAPI_RECEIPT_REQUESTED;
-      
+
       // Pull out the author/originator info
       message->lpOriginator = (lpnsMapiRecipDesc) CoTaskMemAlloc (sizeof(nsMapiRecipDesc));
       memset(message->lpOriginator, 0, sizeof(nsMapiRecipDesc));
       if (message->lpOriginator)
       {
         msgHdr->GetAuthor (getter_Copies(author));
         ConvertRecipientsToMapiFormat(EncodedHeader(author),
           message->lpOriginator, MAPI_ORIG);
@@ -616,24 +616,24 @@ lpnsMapiMessage MsgMapiListContext::GetM
       memset(message->lpRecips, 0, (numToRecips + numCCRecips) * sizeof(MapiRecipDesc));
       if (message->lpRecips)
       {
         ConvertRecipientsToMapiFormat(parsedToRecips, message->lpRecips,
           MAPI_TO);
         ConvertRecipientsToMapiFormat(parsedCCRecips,
           &message->lpRecips[numToRecips], MAPI_CC);
       }
-  
-      MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("MsgMapiListContext::GetMessage flags=%x subject %s date %s sender %s\n", 
+
+      MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("MsgMapiListContext::GetMessage flags=%x subject %s date %s sender %s\n",
         flFlags, (char *) message->lpszSubject,(char *) message->lpszDateReceived, author.get()) );
 
       // Convert any body text that we have locally
       if (!(flFlags & MAPI_ENVELOPE_ONLY))
         message->lpszNoteText = (char *) ConvertBodyToMapiFormat (msgHdr);
-      
+
     }
     if (! (flFlags & (MAPI_PEEK | MAPI_ENVELOPE_ONLY)))
       m_db->MarkRead(key, true, nullptr);
   }
   return message;
 }
 
 
@@ -655,17 +655,17 @@ char *MsgMapiListContext::ConvertDateToM
 
 void MsgMapiListContext::ConvertRecipientsToMapiFormat(
     const nsCOMArray<msgIAddressObject> &recipients,
     lpnsMapiRecipDesc mapiRecips, int mapiRecipClass)
 {
   nsTArray<nsCString> names, addresses;
   ExtractAllAddresses(recipients, UTF16ArrayAdapter<>(names),
     UTF16ArrayAdapter<>(addresses));
-  
+
   size_t numAddresses = names.Length();
   for (size_t i = 0; i < numAddresses; i++)
   {
     if (!names[i].IsEmpty())
     {
       mapiRecips[i].lpszName = (char *) CoTaskMemAlloc(names[i].Length() + 1);
       if (mapiRecips[i].lpszName)
         strcpy((char *)mapiRecips[i].lpszName, names[i].get());
@@ -741,17 +741,17 @@ char *MsgMapiListContext::ConvertBodyToM
       curLine.Append(CRLF);
       // make sure we have room left
       if (bytesCopied + curLine.Length() < msgSize)
       {
         strcpy(body + bytesCopied, curLine.get());
         bytesCopied += curLine.Length();
       }
     }
-    MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("ConvertBodyToMapiFormat size=%x allocated size %x body = %100.100s\n", 
+    MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("ConvertBodyToMapiFormat size=%x allocated size %x body = %100.100s\n",
         bytesCopied, msgSize + 1, (char *) body) );
     body[bytesCopied] = '\0';   // rhp - fix last line garbage...
     return body;
   }
   return nullptr;
 }
 
 
@@ -772,47 +772,47 @@ static void msg_FreeMAPIFile(lpMapiFileD
 static void msg_FreeMAPIRecipient(lpMapiRecipDesc rd)
 {
   if (rd)
   {
     if (rd->lpszName)
       CoTaskMemFree(rd->lpszName);
     if (rd->lpszAddress)
       CoTaskMemFree(rd->lpszAddress);
-    // CoTaskMemFree(rd->lpEntryID);  
+    // CoTaskMemFree(rd->lpEntryID);
   }
 }
 
 extern "C" void MSG_FreeMapiMessage (lpMapiMessage msg)
 {
   ULONG i;
-  
+
   if (msg)
   {
     CoTaskMemFree(msg->lpszSubject);
     CoTaskMemFree(msg->lpszNoteText);
     CoTaskMemFree(msg->lpszMessageType);
     CoTaskMemFree(msg->lpszDateReceived);
     CoTaskMemFree(msg->lpszConversationID);
-    
+
     if (msg->lpOriginator)
       msg_FreeMAPIRecipient(msg->lpOriginator);
-    
+
     for (i=0; i<msg->nRecipCount; i++)
       if (&(msg->lpRecips[i]) != nullptr)
         msg_FreeMAPIRecipient(&(msg->lpRecips[i]));
-      
+
       CoTaskMemFree(msg->lpRecips);
-      
+
       for (i=0; i<msg->nFileCount; i++)
         if (&(msg->lpFiles[i]) != nullptr)
           msg_FreeMAPIFile(&(msg->lpFiles[i]));
-        
+
       CoTaskMemFree(msg->lpFiles);
-      
+
       CoTaskMemFree(msg);
   }
 }
 
 
 extern "C" bool MsgMarkMapiMessageRead (nsIMsgFolder *folder, nsMsgKey key, bool read)
 {
   bool success = FALSE;
@@ -824,27 +824,27 @@ extern "C" bool MsgMarkMapiMessageRead (
       if (NS_SUCCEEDED(context->MarkRead (key, read)))
         success = TRUE;
     }
     delete context;
   }
   return success;
 }
 
-bool 
+bool
 MsgMapiListContext::DeleteMessage(nsMsgKey key)
 {
   if (!m_db)
     return FALSE;
-  
+
   if ( !IsIMAPHost() )
   {
     return NS_SUCCEEDED((m_db->DeleteMessages(1, &key, nullptr)));
   }
-#if 0 
+#if 0
   else if ( m_folder->GetIMAPFolderInfoMail() )
   {
     AutoTArray<nsMsgKey, 1> messageKeys;
     messageKeys.AppendElement(key);
 
     (m_folder->GetIMAPFolderInfoMail())->DeleteSpecifiedMessages(pane, messageKeys, nsMsgKey_None);
     m_db->DeleteMessage(key, nullptr, FALSE);
     return TRUE;
@@ -856,21 +856,21 @@ MsgMapiListContext::DeleteMessage(nsMsgK
   }
 }
 
 /* Return TRUE on success, FALSE on failure */
 extern "C" bool MSG_DeleteMapiMessage(nsIMsgFolder *folder, nsMsgKey key)
 {
   bool success = FALSE;
   MsgMapiListContext *context = new MsgMapiListContext();
-  if (context) 
+  if (context)
   {
     if (NS_SUCCEEDED(context->OpenDatabase(folder)))
     {
       success = context->DeleteMessage(key);
     }
-    
+
     delete context;
   }
-  
+
   return success;
 }
 
--- a/mailnews/mapi/mapihook/src/msgMapiImp.h
+++ b/mailnews/mapi/mapihook/src/msgMapiImp.h
@@ -28,23 +28,23 @@ public :
   // IUnknown
 
   STDMETHODIMP            QueryInterface(const IID& aIid, void** aPpv);
   STDMETHODIMP_(ULONG)    AddRef();
   STDMETHODIMP_(ULONG)    Release();
 
   // Interface INsMapi
 
-  STDMETHODIMP Login(unsigned long aUIArg, LOGIN_PW_TYPE aLogin, 
+  STDMETHODIMP Login(unsigned long aUIArg, LOGIN_PW_TYPE aLogin,
                      LOGIN_PW_TYPE aPassWord, unsigned long aFlags,
                      unsigned long *aSessionId);
 
   STDMETHODIMP SendMail( unsigned long aSession, lpnsMapiMessage aMessage,
-       short aRecipCount, lpnsMapiRecipDesc aRecips , 
-       short aFileCount, lpnsMapiFileDesc aFiles , 
+       short aRecipCount, lpnsMapiRecipDesc aRecips ,
+       short aFileCount, lpnsMapiFileDesc aFiles ,
        unsigned long aFlags, unsigned long aReserved) ;
 
   STDMETHODIMP SendDocuments( unsigned long aSession, LPTSTR aDelimChar,
                               LPTSTR aFilePaths, LPTSTR aFileNames, ULONG aFlags);
 
   STDMETHODIMP FindNext(  unsigned long aSession, unsigned long ulUIParam, LPTSTR lpszMessageType,
                             LPTSTR lpszSeedMessageID, unsigned long flFlags, unsigned long ulReserved,
                             unsigned char lpszMessageID[64] );
--- a/mailnews/mapi/mapihook/src/msgMapiMain.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiMain.cpp
@@ -258,17 +258,17 @@ HRESULT nsMAPIConfiguration::GetMAPIErro
       break;
   }
 
   return hr;
 }
 
 
 nsMAPISession::nsMAPISession(uint32_t aHwnd, const char16_t *aUserName,
-                             const char16_t *aPassword, 
+                             const char16_t *aPassword,
                              bool aForceDownLoad, const char *aKey)
 : m_bIsForcedDownLoad(aForceDownLoad),
   m_hAppHandle(aHwnd),
   m_nShared(1),
   m_pIdKey(aKey)
 {
   m_listContext = NULL;
   m_pProfileName.Assign(aUserName);
--- a/mailnews/mapi/mapihook/src/msgMapiMain.h
+++ b/mailnews/mapi/mapihook/src/msgMapiMain.h
@@ -74,13 +74,13 @@ class nsMAPISession
                   bool aForceDownLoad, const char *aKey);
     uint32_t IncrementSession();
     uint32_t DecrementSession();
     uint32_t GetSessionCount();
     char16_t *nsMAPISession::GetPassword();
     void GetIdKey(nsCString& aKey);
     ~nsMAPISession();
     // For enumerating Messages...
-    void SetMapiListContext( void *listContext) { m_listContext = listContext; } 
+    void SetMapiListContext( void *listContext) { m_listContext = listContext; }
     void *GetMapiListContext( ) { return m_listContext; }
 };
 
 #endif    // MSG_MAPI_MAIN_H_
--- a/mailnews/mapi/mapihook/src/msgMapiSupport.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiSupport.cpp
@@ -32,17 +32,17 @@ nsMapiSupport::Observe(nsISupports *aSub
         return InitializeMAPISupport();
 
     if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
         return ShutdownMAPISupport();
 
     nsCOMPtr<nsIObserverService> observerService =
       mozilla::services::GetObserverService();
     NS_ENSURE_TRUE(observerService, NS_ERROR_UNEXPECTED);
- 
+
     rv = observerService->AddObserver(this,"profile-after-change", false);
     if (NS_FAILED(rv)) return rv;
 
     rv = observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
     if (NS_FAILED(rv))  return rv;
 
     return rv;
 }