r=mkaply, sr=blizzard (platform specific), a=mkaply (OS/2 only)
Patch from dainis jonitis - passing a stack variable as a return from a function - oops!
This commit is contained in:
mkaply%us.ibm.com 2004-09-07 19:07:30 +00:00
Родитель 82051f763e
Коммит 86f73ef744
2 изменённых файлов: 9 добавлений и 12 удалений

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

@ -148,9 +148,9 @@ void SetupDevModeFromSettings(int printer, nsIPrintSettings* aPrintSettings)
pDJP->ulProperty = 0;
pDJP->ulValue = 0;
long rc = GreEscape (hdc, DEVESC_SETJOBPROPERTIES, bufferSize, pDJP_Buffer,
nsDeviceContextSpecOS2::PrnDlg.GetPrintDriverSize(printer),
PBYTE(nsDeviceContextSpecOS2::PrnDlg.GetPrintDriver(printer)));
LONG driverSize = nsDeviceContextSpecOS2::PrnDlg.GetPrintDriverSize(printer);
LONG rc = GreEscape (hdc, DEVESC_SETJOBPROPERTIES, bufferSize, pDJP_Buffer,
&driverSize, PBYTE(nsDeviceContextSpecOS2::PrnDlg.GetPrintDriver(printer)));
delete [] pDJP_Buffer;
DevCloseDC(hdc);
@ -191,9 +191,9 @@ nsresult nsDeviceContextSpecOS2::SetPrintSettingsFromDevMode(nsIPrintSettings* a
pDJP->ulProperty = 0;
pDJP->ulValue = 0;
long rc = GreEscape(hdc, DEVESC_QUERYJOBPROPERTIES, bufferSize, pDJP_Buffer,
nsDeviceContextSpecOS2::PrnDlg.GetPrintDriverSize(printer),
PBYTE(nsDeviceContextSpecOS2::PrnDlg.GetPrintDriver(printer)));
LONG driverSize = nsDeviceContextSpecOS2::PrnDlg.GetPrintDriverSize(printer);
LONG rc = GreEscape(hdc, DEVESC_QUERYJOBPROPERTIES, bufferSize, pDJP_Buffer,
&driverSize, PBYTE(nsDeviceContextSpecOS2::PrnDlg.GetPrintDriver(printer)));
pDJP = (PDJP_ITEM) pDJP_Buffer;
if ((rc == DEV_OK) || (rc == DEV_WARNING)) {
@ -801,12 +801,9 @@ PRTQUEUE* PRINTDLG::SetPrinterQueue (int numPrinter)
return new PRTQUEUE (*pPQ);
}
PLONG PRINTDLG::GetPrintDriverSize (int printer)
LONG PRINTDLG::GetPrintDriverSize (int printer)
{
LONG size = mPQBuf[GetIndex(printer)]->PQI3().pDriverData->cb;
PLONG driverSize = (PLONG)&size;
return driverSize;
return mPQBuf[GetIndex(printer)]->PQI3().pDriverData->cb;
}
PDRIVDATA PRINTDLG::GetPrintDriver (int printer)

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

@ -84,7 +84,7 @@ public:
void GetPrinter (int numPrinter, char** printerName);
PRTQUEUE* SetPrinterQueue (int numPrinter);
HDC GetDCHandle (int numPrinter);
PLONG GetPrintDriverSize (int printer);
LONG GetPrintDriverSize (int printer);
PDRIVDATA GetPrintDriver (int printer);
char* GetDriverType (int printer);
BOOL ShowProperties(int index);