Module: wine Branch: master Commit: 631caae76d0225dd39ab6084cb68771784a5773e URL: http://source.winehq.org/git/wine.git/?a=commit;h=631caae76d0225dd39ab6084cb...
Author: Huw Davies huw@codeweavers.com Date: Wed Oct 21 09:17:49 2015 +0100
wineps: Let CUPS control the copy count rather than embedding it in the PostScript.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wineps.drv/ps.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c index 6187223..a19dda3 100644 --- a/dlls/wineps.drv/ps.c +++ b/dlls/wineps.drv/ps.c @@ -331,6 +331,7 @@ struct ticket_info
static void write_cups_job_ticket( PHYSDEV dev, const struct ticket_info *info ) { + PSDRV_PDEVICE *physDev = get_psdrv_dev( dev ); char buf[256]; int len;
@@ -356,6 +357,14 @@ static void write_cups_job_ticket( PHYSDEV dev, const struct ticket_info *info ) write_spool( dev, str, strlen( str ) ); } } + + if (physDev->Devmode->dmPublic.u1.s1.dmCopies > 1) + { + len = snprintf( buf, sizeof(buf), "%%cupsJobTicket: copies=%d\n", + physDev->Devmode->dmPublic.u1.s1.dmCopies ); + if (len > 0 && len < sizeof(buf)) + write_spool( dev, buf, len ); + } }
INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title ) @@ -414,12 +423,6 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title ) write_spool( dev, psendprolog, strlen(psendprolog) ); write_spool( dev, psbeginsetup, strlen(psbeginsetup) );
- if(physDev->Devmode->dmPublic.u1.s1.dmCopies > 1) { - char copies_buf[100]; - sprintf(copies_buf, "mark {\n << /NumCopies %d >> setpagedevice\n} stopped cleartomark\n", physDev->Devmode->dmPublic.u1.s1.dmCopies); - write_spool(dev, copies_buf, strlen(copies_buf)); - } - if (slot && slot->InvocationString) PSDRV_WriteFeature( dev, "*InputSlot", slot->Name, slot->InvocationString );