Bug 574438 Can't pass null to inout parameters of prompt functions r+sr=bienvenu COMM193a5_20100623_RELBRANCH
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 24 Jun 2010 23:37:20 +0100
branchCOMM193a5_20100623_RELBRANCH
changeset 5910 51b6b3c86072ca4edb6fb43f572cade8cae4ee1b
parent 5909 238198843d19a1ac1875849f0bac15eef68fcc38
child 5911 7d067bc2575cbcdd6c283eafd15f0077fb3299e0
push idunknown
push userunknown
push dateunknown
bugs574438
Bug 574438 Can't pass null to inout parameters of prompt functions r+sr=bienvenu
mailnews/base/util/nsMsgUtils.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsPop3Sink.cpp
mailnews/mapi/mapihook/src/msgMapiHook.cpp
mailnews/news/src/nsNNTPProtocol.cpp
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -2094,17 +2094,17 @@ NS_MSG_BASE nsresult MsgPromptLoginFaile
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsString button2;
   rv = bundle->GetStringFromName(
     NS_LITERAL_STRING("mailServerLoginFailedEnterNewPasswordButton").get(),
     getter_Copies(button2));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  PRBool dummyValue;
+  PRBool dummyValue = PR_FALSE;
   return dialog->ConfirmEx(
     title.get(), message.get(),
     (nsIPrompt::BUTTON_TITLE_IS_STRING * nsIPrompt::BUTTON_POS_0) +
     (nsIPrompt::BUTTON_TITLE_CANCEL * nsIPrompt::BUTTON_POS_1) +
     (nsIPrompt::BUTTON_TITLE_IS_STRING * nsIPrompt::BUTTON_POS_2),
     button0.get(), nsnull, button2.get(), nsnull, &dummyValue, aResult);
 }
 
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -1559,20 +1559,21 @@ NS_IMETHODIMP nsImapMailFolder::EmptyTra
             nsString confirmText;
             nsString folderName;
             folder->GetName(folderName);
             const PRUnichar *formatStrings[1] = { folderName.get() };
             rv = bundle->FormatStringFromID(IMAP_EMPTY_TRASH_CONFIRM,
                                               formatStrings, 1,
                                               getter_Copies(confirmText));
             // Got the text, now show dialog.
+            PRBool dummyValue = PR_FALSE;
             rv = promptService->ConfirmEx(parentWindow, nsnull, confirmText.get(),
                                         (nsIPromptService::BUTTON_TITLE_OK * nsIPromptService::BUTTON_POS_0) +
                                         (nsIPromptService::BUTTON_TITLE_CANCEL * nsIPromptService::BUTTON_POS_1),
-                                          nsnull, nsnull, nsnull, nsnull, nsnull, &dlgResult);
+                                          nsnull, nsnull, nsnull, nsnull, &dummyValue, &dlgResult);
           }
           if (NS_SUCCEEDED(rv) && dlgResult == 1)
             return NS_BINDING_ABORTED;
         }
       }
     }
     if (aListener)
       rv = imapService->DeleteAllMessages(m_thread, trashFolder, aListener, nsnull);
@@ -2520,19 +2521,20 @@ nsImapMailFolder::DeleteSubFolders(nsIAr
     if (dialog)
     {
       PRInt32 buttonPressed = 0;
       // Default the dialog to "cancel".
       const PRUint32 buttonFlags =
         (nsIPrompt::BUTTON_TITLE_IS_STRING * nsIPrompt::BUTTON_POS_0) +
         (nsIPrompt::BUTTON_TITLE_CANCEL * nsIPrompt::BUTTON_POS_1);
 
+      PRBool dummyValue = PR_FALSE;
       rv = dialog->ConfirmEx(deleteFolderDialogTitle.get(), confirmationStr.get(),
                              buttonFlags,  deleteFolderButtonLabel.get(),
-                             nsnull, nsnull, nsnull, nsnull,
+                             nsnull, nsnull, nsnull, &dummyValue,
                              &buttonPressed);
       NS_ENSURE_SUCCESS(rv, rv);
       confirmed = !buttonPressed; // "ok" is in position 0
     }
   }
   else
     confirmed = PR_TRUE;
 
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -1095,19 +1095,20 @@ nsresult nsMsgLocalMailFolder::ConfirmFo
       nsCOMPtr<nsIPrompt> dialog(do_GetInterface(docShell));
       if (dialog)
       {
         PRInt32 buttonPressed = 0;
         // Default the dialog to "cancel".
         const PRUint32 buttonFlags =
           (nsIPrompt::BUTTON_TITLE_IS_STRING * nsIPrompt::BUTTON_POS_0) +
           (nsIPrompt::BUTTON_TITLE_CANCEL * nsIPrompt::BUTTON_POS_1);
+        PRBool dummyValue = PR_FALSE;
         rv = dialog->ConfirmEx(deleteFolderDialogTitle.get(), confirmationStr.get(),
                                buttonFlags,  deleteFolderButtonLabel.get(),
-                               nsnull, nsnull, nsnull, nsnull,
+                               nsnull, nsnull, nsnull, &dummyValue,
                                &buttonPressed);
         NS_ENSURE_SUCCESS(rv, rv);
         *aResult = !buttonPressed; // "ok" is in position 0
       }
     }
     else
       *aResult = PR_TRUE;
   }
--- a/mailnews/local/src/nsPop3Sink.cpp
+++ b/mailnews/local/src/nsPop3Sink.cpp
@@ -776,23 +776,24 @@ nsresult nsPop3Sink::HandleTempDownloadF
   if (msgWindow)
   {
     (void) msgWindow->GetRootDocShell(getter_AddRefs(docShell));
     parentWindow = do_QueryInterface(docShell);
   }
   if (promptService && !confirmString.IsEmpty())
   {
     PRInt32 dlgResult  = -1;
+    PRBool dummyValue = PR_FALSE;
     rv = promptService->ConfirmEx(parentWindow, nsnull, confirmString.get(),
                       nsIPromptService::STD_YES_NO_BUTTONS,
                       nsnull,
                       nsnull,
                       nsnull,
                       nsnull,
-                      nsnull,
+                      &dummyValue,
                       &dlgResult);
     m_newMailParser->m_newMsgHdr = nsnull;
 
     return (dlgResult == 0) ? NS_OK : NS_MSG_ERROR_COPYING_FROM_TMP_DOWNLOAD;
   }
   return rv;
 }
 
--- a/mailnews/mapi/mapihook/src/msgMapiHook.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiHook.cpp
@@ -197,34 +197,36 @@ PRBool nsMapiHook::DisplayLoginDialog(PR
 
     if (aLogin)
     {
       nsString loginText;
       rv = bundle->GetStringFromName(NS_LITERAL_STRING("loginTextwithName").get(),
                                      getter_Copies(loginText));
       if (NS_FAILED(rv) || loginText.IsEmpty()) return PR_FALSE;
 
+      PRBool dummyValue = PR_FALSE;
       rv = dlgService->PromptUsernameAndPassword(nsnull, loginTitle.get(),
                                                  loginText.get(), aUsername, aPassword,
-                                                 nsnull, PR_FALSE, &btnResult);
+                                                 nsnull, &dummyValue, &btnResult);
     }
     else
     {
       //nsString loginString;
       nsString loginText;
       const PRUnichar *userNameStrings[] = { *aUsername };
 
       NS_NAMED_LITERAL_STRING(loginTextPropertyTag, "loginText");
       const PRUnichar *dpropertyTag = loginTextPropertyTag.get();
       rv = bundle->FormatStringFromName(dpropertyTag, userNameStrings, 1,
                                         getter_Copies(loginText));
       if (NS_FAILED(rv)) return PR_FALSE;
 
+      PRBool dummyValue = PR_FALSE;
       rv = dlgService->PromptPassword(nsnull, loginTitle.get(), loginText.get(),
-                                      aPassword, nsnull, PR_FALSE, &btnResult);
+                                      aPassword, nsnull, &dummyValue, &btnResult);
     }
   }
 
   return btnResult;
 }
 
 PRBool nsMapiHook::VerifyUserName(const nsString& aUsername, nsCString& aIdKey)
 {
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -4094,18 +4094,19 @@ reported here */
   else
     NNTP_LOG_NOTE("CANCELCHK supported, don't do the us vs. them test");
 
   // QA needs to be able to disable this confirm dialog, for the automated tests.  see bug #31057
   rv = prefBranch->GetBoolPref(PREF_NEWS_CANCEL_CONFIRM, &requireConfirmationForCancel);
   if (NS_FAILED(rv) || requireConfirmationForCancel) {
     /* Last chance to cancel the cancel.*/
     GetNewsStringByName("cancelConfirm", getter_Copies(confirmText));
+    PRBool dummyValue = PR_FALSE;
     rv = dialog->ConfirmEx(nsnull, confirmText.get(), nsIPrompt::STD_YES_NO_BUTTONS,
-                           nsnull, nsnull, nsnull, nsnull, nsnull, &confirmCancelResult);
+                           nsnull, nsnull, nsnull, nsnull, &dummyValue, &confirmCancelResult);
     if (NS_FAILED(rv))
     	confirmCancelResult = 1; // Default to No.
   }
   else
     confirmCancelResult = 0; // Default to Yes.
     
   if (confirmCancelResult != 0) {
       // they cancelled the cancel