Commit 61efdbfd authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

wineps: Add a helper to find an input slot.

parent c9178fdf
......@@ -45,6 +45,17 @@ static inline int paper_size_from_points( float size )
return size * 254 / 72;
}
INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm )
{
INPUTSLOT *slot;
LIST_FOR_EACH_ENTRY( slot, &ppd->InputSlots, INPUTSLOT, entry )
if (slot->WinBin == dm->dmPublic.u1.s1.dmDefaultSource)
return slot;
return NULL;
}
/************************************************************************
*
* PSDRV_MergeDevmodes
......@@ -117,13 +128,9 @@ void PSDRV_MergeDevmodes( PSDRV_DEVMODE *dm1, PSDRV_DEVMODE *dm2, PRINTERINFO *p
if (dm2->dmPublic.dmFields & DM_DEFAULTSOURCE)
{
INPUTSLOT *slot;
LIST_FOR_EACH_ENTRY( slot, &pi->ppd->InputSlots, INPUTSLOT, entry )
if(slot->WinBin == dm2->dmPublic.u1.s1.dmDefaultSource)
break;
INPUTSLOT *slot = find_slot( pi->ppd, dm2 );
if (&slot->entry != &pi->ppd->InputSlots)
if (slot)
{
dm1->dmPublic.u1.s1.dmDefaultSource = dm2->dmPublic.u1.s1.dmDefaultSource;
TRACE("Changing bin to '%s'\n", slot->FullName);
......
......@@ -301,7 +301,7 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
{
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
char *buf, *escaped_title;
INPUTSLOT *slot;
INPUTSLOT *slot = find_slot( physDev->pi->ppd, physDev->Devmode );
PAGESIZE *page;
DUPLEX *duplex;
int win_duplex;
......@@ -350,15 +350,8 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
write_spool(dev, copies_buf, strlen(copies_buf));
}
LIST_FOR_EACH_ENTRY( slot, &physDev->pi->ppd->InputSlots, INPUTSLOT, entry ) {
if(slot->WinBin == physDev->Devmode->dmPublic.u1.s1.dmDefaultSource) {
if(slot->InvocationString) {
PSDRV_WriteFeature(dev, "*InputSlot", slot->Name,
slot->InvocationString);
break;
}
}
}
if (slot && slot->InvocationString)
PSDRV_WriteFeature( dev, "*InputSlot", slot->Name, slot->InvocationString );
LIST_FOR_EACH_ENTRY(page, &physDev->pi->ppd->PageSizes, PAGESIZE, entry) {
if(page->WinPage == physDev->Devmode->dmPublic.u1.s1.dmPaperSize) {
......
......@@ -401,6 +401,8 @@ extern HINSTANCE PSDRV_hInstance DECLSPEC_HIDDEN;
extern HANDLE PSDRV_Heap DECLSPEC_HIDDEN;
extern char *PSDRV_ANSIVector[256] DECLSPEC_HIDDEN;
extern INPUTSLOT *find_slot( PPD *ppd, PSDRV_DEVMODE *dm );
/* GDI driver functions */
extern BOOL PSDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment