Bug 1521007 - Follow-up: fix variable name of UTF-8 indicator. r+a=me
authorJorg K <jorgk@jorgk.com>
Sat, 19 Jan 2019 08:11:36 +0100
changeset 33952 18b2c9cbcf7c3adc5c1e2c89e401363987c92174
parent 33951 4882e4a21d50cf2a76e2fb9087f3d44c6018ce58
child 33953 2c97e77600fbe828bdf012098cd7dbab64a4aa47
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
bugs1521007
Bug 1521007 - Follow-up: fix variable name of UTF-8 indicator. r+a=me
mailnews/mapi/mapihook/src/msgMapiHook.cpp
mailnews/mapi/mapihook/src/msgMapiHook.h
--- a/mailnews/mapi/mapihook/src/msgMapiHook.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiHook.cpp
@@ -341,17 +341,17 @@ nsresult nsMapiHook::BlindSendMail (unsi
     PR_CExitMonitor(pSendListener);
     NS_ProcessPendingEvents(thread);
   }
 
   return rv ;
 }
 
 nsresult nsMapiHook::HandleAttachments (nsIMsgCompFields * aCompFields, int32_t aFileCount,
-                                        lpnsMapiFileDesc aFiles, bool bUTF8)
+                                        lpnsMapiFileDesc aFiles, bool aIsUTF8)
 {
     nsresult rv = NS_OK ;
     // Do nothing if there are no files to process.
     if (!aFiles || aFileCount <= 0)
         return NS_OK;
 
     nsAutoCString Attachments ;
     nsAutoCString TempFiles ;
@@ -390,17 +390,17 @@ nsresult nsMapiHook::HandleAttachments (
 
             nsAutoString leafName ;
             // convert to Unicode using Platform charset
             // leafName already contains a unicode leafName from lpszPathName. If we were given
             // a value for lpszFileName, use it. Otherwise stick with leafName
             if (aFiles[i].lpszFileName)
             {
                 nsAutoString wholeFileName;
-                if (!bUTF8)
+                if (!aIsUTF8)
                     NS_CopyNativeToUnicode(nsDependentCString(aFiles[i].lpszFileName),
                                            wholeFileName);
                 else
                     wholeFileName.Append(NS_ConvertUTF8toUTF16(aFiles[i].lpszFileName));
                 // need to find the last '\' and find the leafname from that.
                 int32_t lastSlash = wholeFileName.RFindChar(char16_t('\\'));
                 if (lastSlash != kNotFound)
                   leafName.Assign(Substring(wholeFileName, lastSlash + 1));
@@ -567,22 +567,22 @@ nsresult nsMapiHook::HandleAttachmentsW(
   return rv ;
 }
 
 // this is used to convert non Unicode data and then populate comp fields
 nsresult nsMapiHook::PopulateCompFieldsWithConversion(lpnsMapiMessage aMessage,
                                     nsIMsgCompFields * aCompFields)
 {
   nsresult rv = NS_OK;
-  bool bUTF8 = aMessage->ulReserved == CP_UTF8;
+  bool isUTF8 = aMessage->ulReserved == CP_UTF8;
 
   if (aMessage->lpOriginator)
   {
     nsAutoString From;
-    if (!bUTF8)
+    if (!isUTF8)
         From.Append(NS_ConvertASCIItoUTF16(aMessage->lpOriginator->lpszAddress));
     else
         From.Append(NS_ConvertUTF8toUTF16(aMessage->lpOriginator->lpszAddress));
     aCompFields->SetFrom (From);
   }
 
   nsAutoString To;
   nsAutoString Cc;
@@ -599,35 +599,35 @@ nsresult nsMapiHook::PopulateCompFieldsW
         if (!PL_strncasecmp(addressWithoutType, "SMTP:", 5))
           addressWithoutType += 5;
 
         switch (aMessage->lpRecips[i].ulRecipClass)
         {
         case MAPI_TO :
           if (!To.IsEmpty())
             To += Comma ;
-          if (!bUTF8)
+          if (!isUTF8)
               To.Append(NS_ConvertASCIItoUTF16(addressWithoutType));
           else
               To.Append(NS_ConvertUTF8toUTF16(addressWithoutType));
           break ;
 
         case MAPI_CC :
           if (!Cc.IsEmpty())
             Cc += Comma ;
-          if (!bUTF8)
+          if (!isUTF8)
               Cc.Append(NS_ConvertASCIItoUTF16(addressWithoutType));
           else
               Cc.Append(NS_ConvertUTF8toUTF16(addressWithoutType));
           break ;
 
         case MAPI_BCC :
           if (!Bcc.IsEmpty())
               Bcc += Comma ;
-          if (!bUTF8)
+          if (!isUTF8)
               Bcc.Append(NS_ConvertASCIItoUTF16(addressWithoutType));
           else
               Bcc.Append(NS_ConvertUTF8toUTF16(addressWithoutType));
           break ;
         }
       }
     }
   }
@@ -638,34 +638,34 @@ nsresult nsMapiHook::PopulateCompFieldsW
   aCompFields->SetBcc (Bcc) ;
 
   MOZ_LOG(MAPI, mozilla::LogLevel::Debug, ("to: %s cc: %s bcc: %s \n", NS_ConvertUTF16toUTF8(To).get(), NS_ConvertUTF16toUTF8(Cc).get(), NS_ConvertUTF16toUTF8(Bcc).get()));
 
   // set subject
   if (aMessage->lpszSubject)
   {
     nsAutoString Subject ;
-    if (!bUTF8)
+    if (!isUTF8)
         rv = NS_CopyNativeToUnicode(nsDependentCString(aMessage->lpszSubject),
                                     Subject);
     else
         Subject.Append(NS_ConvertUTF8toUTF16(aMessage->lpszSubject));
     if (NS_FAILED(rv)) return rv;
     aCompFields->SetSubject(Subject);
   }
 
   // handle attachments as File URL
-  rv = HandleAttachments(aCompFields, aMessage->nFileCount, aMessage->lpFiles, bUTF8);
+  rv = HandleAttachments(aCompFields, aMessage->nFileCount, aMessage->lpFiles, isUTF8);
   if (NS_FAILED(rv)) return rv ;
 
   // set body
   if (aMessage->lpszNoteText)
   {
     nsAutoString Body ;
-    if (!bUTF8)
+    if (!isUTF8)
         rv = NS_CopyNativeToUnicode(nsDependentCString(aMessage->lpszNoteText),
                                     Body);
     else
         Body.Append(NS_ConvertUTF8toUTF16(aMessage->lpszNoteText));
     if (NS_FAILED(rv)) return rv ;
     if (Body.IsEmpty() || Body.Last() != '\n')
       Body.AppendLiteral(CRLF);
 
--- a/mailnews/mapi/mapihook/src/msgMapiHook.h
+++ b/mailnews/mapi/mapihook/src/msgMapiHook.h
@@ -19,17 +19,17 @@ class nsMapiHook
         static nsresult BlindSendMail (unsigned long aSession, nsIMsgCompFields * aCompFields) ;
         static nsresult ShowComposerWindow (unsigned long aSession, nsIMsgCompFields * aCompFields) ;
         static nsresult PopulateCompFieldsWithConversion(lpnsMapiMessage aMessage,
                                         nsIMsgCompFields * aCompFields) ;
         static nsresult PopulateCompFieldsW(lpnsMapiMessageW aMessage, nsIMsgCompFields *aCompFields);
         static nsresult PopulateCompFieldsForSendDocs(nsIMsgCompFields * aCompFields,
                                         ULONG aFlags, LPTSTR aDelimChar, LPTSTR aFilePaths) ;
         static nsresult HandleAttachments(nsIMsgCompFields *aCompFields, int32_t aFileCount,
-                                          lpnsMapiFileDesc aFiles, bool bUTF8);
+                                          lpnsMapiFileDesc aFiles, bool aIsUTF8);
         static nsresult HandleAttachmentsW(nsIMsgCompFields *aCompFields, int32_t aFileCount,
                                            lpnsMapiFileDescW aFiles);
         static void CleanUp();
 
         static bool isMapiService;
 };
 
 #endif  // MSG_MAPI_HOOK_H_