add early returns to nsMsgFilterAfterTheFact::ContinueExecutionPrompt, r=bienvenu

This commit is contained in:
timeless 2011-08-26 15:35:39 -07:00
Родитель 4a7b4e9beb
Коммит 97921ff945
1 изменённых файлов: 23 добавлений и 24 удалений

Просмотреть файл

@ -1066,17 +1066,16 @@ NS_IMETHODIMP nsMsgFilterAfterTheFact::OnStopCopy(nsresult aStatus)
PRBool nsMsgFilterAfterTheFact::ContinueExecutionPrompt()
{
PRBool returnVal = PR_FALSE;
if (!m_curFilter)
return returnVal;
nsresult rv;
nsCOMPtr <nsIStringBundle> bundle;
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
if (bundleService && NS_SUCCEEDED(rv))
return PR_FALSE;
nsCOMPtr<nsIStringBundle> bundle;
nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID);
if (!bundleService)
return PR_FALSE;
bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
getter_AddRefs(bundle));
if (NS_SUCCEEDED(rv) && bundle)
{
if (!bundle)
return PR_FALSE;
nsString filterName;
m_curFilter->GetFilterName(filterName);
nsString formatString;
@ -1085,15 +1084,15 @@ PRBool nsMsgFilterAfterTheFact::ContinueExecutionPrompt()
{
filterName.get()
};
rv = bundle->FormatStringFromName(NS_LITERAL_STRING("continueFilterExecution").get(),
nsresult rv = bundle->FormatStringFromName(NS_LITERAL_STRING("continueFilterExecution").get(),
formatStrings, 1, getter_Copies(confirmText));
if (NS_SUCCEEDED(rv))
{
rv = DisplayConfirmationPrompt(m_msgWindow, confirmText.get(), &returnVal);
}
}
if (NS_FAILED(rv))
return PR_FALSE;
PRBool returnVal = PR_FALSE;
(void) DisplayConfirmationPrompt(m_msgWindow, confirmText.get(), &returnVal);
return returnVal;
}
nsresult
nsMsgFilterAfterTheFact::DisplayConfirmationPrompt(nsIMsgWindow *msgWindow, const PRUnichar *confirmString, PRBool *confirmed)
{