зеркало из https://github.com/mozilla/pjs.git
Fix for bug 270812: Cannot print after printer was renamed
Patch by Masayuki Nakano, r=emaijala sr=bzbarsky
This commit is contained in:
Родитель
cbf2ae3323
Коммит
c1d97a4b9d
|
@ -861,6 +861,17 @@ ShowNativePrintDialog(HWND aHWnd,
|
|||
// If there is no name then use the default printer
|
||||
if (!printerName || (printerName && !*printerName)) {
|
||||
printerName = GetDefaultPrinterNameFromGlobalPrinters();
|
||||
} else {
|
||||
HANDLE hPrinter = NULL;
|
||||
nsCAutoString printerNameNative;
|
||||
NS_CopyUnicodeToNative(nsDependentString(printerName), printerNameNative);
|
||||
LPTSTR tempPrinterName = NS_CONST_CAST(char*, printerNameNative.get());
|
||||
if(!::OpenPrinter(tempPrinterName, &hPrinter, NULL)) {
|
||||
// If the last used printer is not found, we should use default printer.
|
||||
printerName = GetDefaultPrinterNameFromGlobalPrinters();
|
||||
} else {
|
||||
::ClosePrinter(hPrinter);
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(printerName, "We have to have a printer name");
|
||||
|
|
Загрузка…
Ссылка в новой задаче