Bug 398342 - Print Preview says An unknown error occurred while printing. when there's no printer installed, r=mats.palmgren, sr=roc, a=mtschrep

This commit is contained in:
martijn.martijn@gmail.com 2007-12-04 07:56:17 -08:00
Родитель 4f77545328
Коммит 1cee792cb6
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -418,7 +418,8 @@ NS_IMETHODIMP nsDeviceContextSpecWin::Init(nsIWidget* aWidget,
{
mPrintSettings = aPrintSettings;
nsresult rv = NS_ERROR_FAILURE;
nsresult rv = aIsPrintPreview ? NS_ERROR_GFX_PRINTER_PRINTPREVIEW :
NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE;
if (aPrintSettings) {
nsCOMPtr<nsIPrintSettingsWin> psWin(do_QueryInterface(aPrintSettings));
if (psWin) {
@ -483,7 +484,7 @@ NS_IMETHODIMP nsDeviceContextSpecWin::Init(nsIWidget* aWidget,
}
NS_ASSERTION(printerName, "We have to have a printer name");
if (!printerName || !*printerName) return NS_ERROR_FAILURE;
if (!printerName || !*printerName) return rv;
if (!aIsPrintPreview) {
CheckForPrintToFile(mPrintSettings, nsnull, printerName);