Patch level : 2.0 672

Files correlati     : xvagadll.dll
Ricompilazione Demo : [ ]
Commento            :

Correzione stampa registri errata su "HP OfficeJet G Series Printer"


git-svn-id: svn://10.65.10.50/trunk@11718 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2004-01-22 15:10:39 +00:00
parent 81a525baa0
commit dffac44daa
2 changed files with 11 additions and 7 deletions

View File

@ -157,7 +157,8 @@ void* OsWin32_GetPrinterInfo(int& size, const char* printer)
size = ::DocumentProperties(0, hPrinter, name, NULL, NULL, 0); // Determina dimensione DEVMODE
if (size > 0)
{
pdm = (LPDEVMODE) new char[size]; // Alloca un DEVMODE sufficientemente capiente
pdm = (LPDEVMODE)new char[size]; // Alloca un DEVMODE sufficientemente capiente
memset(pdm, 0, size);
::DocumentProperties(0, hPrinter, name, pdm, NULL, DM_OUT_BUFFER); // Legge DEVMODE
}
else
@ -197,8 +198,9 @@ bool OsWin32_DrawBitmap(const wxBitmap& bmp, wxDC& dc, const wxRect& dst, const
const int nTechno = ::GetDeviceCaps(hDC, TECHNOLOGY);
if (nTechno == DT_RASPRINTER) // Sto stampando!
{
BITMAPINFO* bi = (BITMAPINFO *) malloc( sizeof( BITMAPINFOHEADER ) + 256 * sizeof(RGBQUAD ) );
memset(bi, 0, sizeof( BITMAPINFOHEADER ) );
const size_t bi_size = sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD);
BITMAPINFO* bi = (BITMAPINFO*)malloc(bi_size);
memset(bi, 0, bi_size);
BITMAPINFOHEADER& bih = bi->bmiHeader;
bih.biSize = sizeof(bih);
@ -707,10 +709,10 @@ BOOL OsWin32_SpoolRow(const char* pData,
bAbort = FALSE;
iEsc = PASSTHROUGH;
if (!Escape(hPrnDC, QUERYESCSUPPORT, sizeof(int), (LPSTR)&iEsc, NULL))
{
{
bAbort = TRUE;
goto MPLCleanUp;
}
}
// Call EPSPRINTING if it is supported (that is, if we're on a
// PostScript printer) to suppress downloading the pscript header.
@ -718,8 +720,8 @@ BOOL OsWin32_SpoolRow(const char* pData,
iEsc = EPSPRINTING;
if (Escape(hPrnDC, QUERYESCSUPPORT, sizeof(int), (LPSTR)&iEsc, NULL))
{
iEsc = 1; // 1 == enable PASSTHROUGH (disable pscript header)
Escape(hPrnDC, EPSPRINTING, sizeof(int), (LPSTR)&iEsc, NULL);
iEsc = 1; // 1 == enable PASSTHROUGH (disable pscript header)
Escape(hPrnDC, EPSPRINTING, sizeof(int), (LPSTR)&iEsc, NULL);
}

View File

@ -34,6 +34,8 @@ void TPRINT_RCD::SetData(void* data, unsigned int nSize)
memcpy(m_data, data, nSize);
m_size = nSize;
}
else
xvt_dm_post_error("Printer info exceeds 16K");
}
TPRINT_RCD::TPRINT_RCD() : m_size(0)