mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 19:27:17 +00:00
wineps.drv: Use first page DEVMODE to determine number of copies and collation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55718
This commit is contained in:
parent
12c3579bcb
commit
7128a6595a
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <ntgdi.h>
|
#include <ntgdi.h>
|
||||||
|
#include <winppi.h>
|
||||||
#include <winspool.h>
|
#include <winspool.h>
|
||||||
#include <ddk/winsplp.h>
|
#include <ddk/winsplp.h>
|
||||||
#include <usp10.h>
|
#include <usp10.h>
|
||||||
|
@ -40,6 +41,7 @@ struct pp_data
|
||||||
{
|
{
|
||||||
DWORD magic;
|
DWORD magic;
|
||||||
HANDLE hport;
|
HANDLE hport;
|
||||||
|
WCHAR *port;
|
||||||
WCHAR *doc_name;
|
WCHAR *doc_name;
|
||||||
WCHAR *out_file;
|
WCHAR *out_file;
|
||||||
|
|
||||||
|
@ -2980,6 +2982,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
|
||||||
return NULL;
|
return NULL;
|
||||||
data->magic = PP_MAGIC;
|
data->magic = PP_MAGIC;
|
||||||
data->hport = hport;
|
data->hport = hport;
|
||||||
|
data->port = wcsdup(port);
|
||||||
data->doc_name = wcsdup(open_data->pDocumentName);
|
data->doc_name = wcsdup(open_data->pDocumentName);
|
||||||
data->out_file = wcsdup(open_data->pOutputFile);
|
data->out_file = wcsdup(open_data->pOutputFile);
|
||||||
|
|
||||||
|
@ -3003,6 +3006,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
|
||||||
BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name)
|
BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name)
|
||||||
{
|
{
|
||||||
struct pp_data *data = get_handle_data(pp);
|
struct pp_data *data = get_handle_data(pp);
|
||||||
|
DEVMODEW *devmode = NULL;
|
||||||
emfspool_header header;
|
emfspool_header header;
|
||||||
LARGE_INTEGER pos, cur;
|
LARGE_INTEGER pos, cur;
|
||||||
record_hdr record;
|
record_hdr record;
|
||||||
|
@ -3016,6 +3020,21 @@ BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name)
|
||||||
if (!data)
|
if (!data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
spool_data = GdiGetSpoolFileHandle(data->port,
|
||||||
|
&data->ctx->Devmode->dmPublic, doc_name);
|
||||||
|
GdiGetDevmodeForPage(spool_data, 1, &devmode, NULL);
|
||||||
|
if (devmode && devmode->dmFields & DM_COPIES)
|
||||||
|
{
|
||||||
|
data->ctx->Devmode->dmPublic.dmFields |= DM_COPIES;
|
||||||
|
data->ctx->Devmode->dmPublic.dmCopies = devmode->dmCopies;
|
||||||
|
}
|
||||||
|
if (devmode && devmode->dmFields & DM_COLLATE)
|
||||||
|
{
|
||||||
|
data->ctx->Devmode->dmPublic.dmFields |= DM_COLLATE;
|
||||||
|
data->ctx->Devmode->dmPublic.dmCollate = devmode->dmCollate;
|
||||||
|
}
|
||||||
|
GdiDeleteSpoolFileHandle(spool_data);
|
||||||
|
|
||||||
if (!OpenPrinterW(doc_name, &spool_data, NULL))
|
if (!OpenPrinterW(doc_name, &spool_data, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -3166,6 +3185,7 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
ClosePrinter(data->hport);
|
ClosePrinter(data->hport);
|
||||||
|
free(data->port);
|
||||||
free(data->doc_name);
|
free(data->doc_name);
|
||||||
free(data->out_file);
|
free(data->out_file);
|
||||||
DeleteDC(data->ctx->hdc);
|
DeleteDC(data->ctx->hdc);
|
||||||
|
|
Loading…
Reference in a new issue