we were not setting the values we modified in the DevMode back into the printer driver

Bug 169739 r=dcone sr=alecf
This commit is contained in:
rods%netscape.com 2006-02-07 01:14:18 +00:00
Родитель f69645581e
Коммит 1556293328
1 изменённых файлов: 12 добавлений и 10 удалений

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

@ -660,19 +660,21 @@ nsDeviceContextSpecWin::GetDataFromPrinter(const PRUnichar * aName, nsIPrintSett
dwRet = DocumentProperties(gParentWnd, hPrinter, (char*)NS_ConvertUCS2toUTF8(aName).get(),
pDevMode, NULL, DM_OUT_BUFFER);
if (dwRet == IDOK && aPS) {
SetupDevModeFromSettings(pDevMode, aPS);
// Sets back the changes we made to the DevMode into the Printer Driver
dwRet = ::DocumentProperties(gParentWnd, hPrinter, (char*)NS_ConvertUCS2toUTF8(aName).get(), pDevMode, pDevMode, DM_IN_BUFFER | DM_OUT_BUFFER);
}
if (dwRet != IDOK) {
::HeapFree(::GetProcessHeap(), 0, pDevMode);
::ClosePrinter(hPrinter);
PR_PL(("***** nsDeviceContextSpecWin::GetDataFromPrinter - DocumentProperties call failed code: %d/0x%x\n", dwRet, dwRet));
DISPLAY_LAST_ERROR
return rv;
return NS_ERROR_FAILURE;
}
if (aPS) {
SetupDevModeFromSettings(pDevMode, aPS);
}
SetDevMode(pDevMode);
SetDevMode(pDevMode); // cache the pointer and takes responsibility for the memory
SetDeviceName((char*)NS_ConvertUCS2toUTF8(aName).get());