Checking in for roland.mainz@nrubsig.org, bug 234982. Making print errors always be reported to the user. r+sr=roc@ocallahan.org

This commit is contained in:
jst%mozilla.jstenback.com 2004-02-20 20:59:55 +00:00
Родитель f218d03481
Коммит 09b4fb5ea6
2 изменённых файлов: 22 добавлений и 20 удалений

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

@ -2286,9 +2286,7 @@ nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError, PRBool aIsPrinting)
#undef NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG #undef NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG
} }
PR_PL(("*******************************************\n")); PR_PL(("ShowPrintErrorDialog: stringName='%s'\n", NS_LossyConvertUCS2toASCII(stringName).get()));
PR_PL(("*** ShowPrintErrorDialog %s\n", NS_LossyConvertUCS2toASCII(stringName).get()));
PR_PL(("*******************************************\n"));
myStringBundle->GetStringFromName(stringName.get(), getter_Copies(msg)); myStringBundle->GetStringFromName(stringName.get(), getter_Copies(msg));
if (aIsPrinting) { if (aIsPrinting) {
@ -2303,22 +2301,25 @@ nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError, PRBool aIsPrinting)
} }
nsCOMPtr<nsIWindowWatcher> wwatch = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv); nsCOMPtr<nsIWindowWatcher> wwatch = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
if (NS_FAILED(rv)) if (NS_FAILED(rv)) {
PR_PL(("ShowPrintErrorDialog(): wwatch==nsnull\n"));
return; return;
}
nsCOMPtr<nsIDOMWindow> active; nsCOMPtr<nsIDOMWindow> active;
wwatch->GetActiveWindow(getter_AddRefs(active)); wwatch->GetActiveWindow(getter_AddRefs(active));
nsCOMPtr<nsIDOMWindowInternal> parent = do_QueryInterface(active);
if (!parent)
return;
nsCOMPtr<nsIPrompt> dialog; nsCOMPtr<nsIPrompt> dialog;
parent->GetPrompter(getter_AddRefs(dialog)); /* |GetNewPrompter| allows that |active| is |nsnull|
if (!dialog) * (see bug 234982 ("nsPrintEngine::ShowPrintErrorDialog() fails in many cases")) */
wwatch->GetNewPrompter(active, getter_AddRefs(dialog));
if (!dialog) {
PR_PL(("ShowPrintErrorDialog(): dialog==nsnull\n"));
return; return;
}
dialog->Alert(title, msg); dialog->Alert(title, msg);
PR_PL(("ShowPrintErrorDialog(): alert displayed successfully.\n"));
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------

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

@ -2286,9 +2286,7 @@ nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError, PRBool aIsPrinting)
#undef NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG #undef NS_ERROR_TO_LOCALIZED_PRINT_ERROR_MSG
} }
PR_PL(("*******************************************\n")); PR_PL(("ShowPrintErrorDialog: stringName='%s'\n", NS_LossyConvertUCS2toASCII(stringName).get()));
PR_PL(("*** ShowPrintErrorDialog %s\n", NS_LossyConvertUCS2toASCII(stringName).get()));
PR_PL(("*******************************************\n"));
myStringBundle->GetStringFromName(stringName.get(), getter_Copies(msg)); myStringBundle->GetStringFromName(stringName.get(), getter_Copies(msg));
if (aIsPrinting) { if (aIsPrinting) {
@ -2303,22 +2301,25 @@ nsPrintEngine::ShowPrintErrorDialog(nsresult aPrintError, PRBool aIsPrinting)
} }
nsCOMPtr<nsIWindowWatcher> wwatch = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv); nsCOMPtr<nsIWindowWatcher> wwatch = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
if (NS_FAILED(rv)) if (NS_FAILED(rv)) {
PR_PL(("ShowPrintErrorDialog(): wwatch==nsnull\n"));
return; return;
}
nsCOMPtr<nsIDOMWindow> active; nsCOMPtr<nsIDOMWindow> active;
wwatch->GetActiveWindow(getter_AddRefs(active)); wwatch->GetActiveWindow(getter_AddRefs(active));
nsCOMPtr<nsIDOMWindowInternal> parent = do_QueryInterface(active);
if (!parent)
return;
nsCOMPtr<nsIPrompt> dialog; nsCOMPtr<nsIPrompt> dialog;
parent->GetPrompter(getter_AddRefs(dialog)); /* |GetNewPrompter| allows that |active| is |nsnull|
if (!dialog) * (see bug 234982 ("nsPrintEngine::ShowPrintErrorDialog() fails in many cases")) */
wwatch->GetNewPrompter(active, getter_AddRefs(dialog));
if (!dialog) {
PR_PL(("ShowPrintErrorDialog(): dialog==nsnull\n"));
return; return;
}
dialog->Alert(title, msg); dialog->Alert(title, msg);
PR_PL(("ShowPrintErrorDialog(): alert displayed successfully.\n"));
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------