Commit cd4f48f2 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wineps: Store page size full name as unicode string.

parent bcb5fabc
......@@ -126,13 +126,13 @@ void PSDRV_MergeDevmodes( PSDRV_DEVMODE *dm1, const PSDRV_DEVMODE *dm2, PRINTERI
dm1->dmPublic.dmPaperWidth = paper_size_from_points( page->PaperDimension->x );
dm1->dmPublic.dmPaperLength = paper_size_from_points( page->PaperDimension->y );
dm1->dmPublic.dmFields |= DM_PAPERSIZE | DM_PAPERWIDTH | DM_PAPERLENGTH;
TRACE("Changing page to %s %d x %d\n", page->FullName,
TRACE("Changing page to %s %d x %d\n", debugstr_w(page->FullName),
dm1->dmPublic.dmPaperWidth,
dm1->dmPublic.dmPaperLength );
if (dm1->dmPublic.dmSize >= FIELD_OFFSET(DEVMODEW, dmFormName) + CCHFORMNAME * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, page->FullName, -1, dm1->dmPublic.dmFormName, CCHFORMNAME);
lstrcpynW(dm1->dmPublic.dmFormName, page->FullName, CCHFORMNAME);
dm1->dmPublic.dmFields |= DM_FORMNAME;
}
}
......@@ -351,7 +351,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
i++;
}
TRACE("Setting pagesize to item %d, WinPage %d (%s), PaperSize %.2fx%.2f\n", Cursel,
ps->WinPage, ps->FullName, ps->PaperDimension->x, ps->PaperDimension->y);
ps->WinPage, debugstr_w(ps->FullName), ps->PaperDimension->x, ps->PaperDimension->y);
di->dlgdm->dmPublic.dmPaperSize = ps->WinPage;
di->dlgdm->dmPublic.dmFields |= DM_PAPERSIZE;
......@@ -361,7 +361,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
if (di->dlgdm->dmPublic.dmSize >= FIELD_OFFSET(DEVMODEW, dmFormName) + CCHFORMNAME * sizeof(WCHAR))
{
MultiByteToWideChar(CP_ACP, 0, ps->FullName, -1, di->dlgdm->dmPublic.dmFormName, CCHFORMNAME);
lstrcpynW(di->dlgdm->dmPublic.dmFormName, ps->FullName, CCHFORMNAME);
di->dlgdm->dmPublic.dmFields |= DM_FORMNAME;
}
SendMessageW(GetParent(hwnd), PSM_CHANGED, 0, 0);
......@@ -599,10 +599,10 @@ DWORD WINAPI DrvDeviceCapabilities(HANDLE printer, WCHAR *device_name, WORD capa
LIST_FOR_EACH_ENTRY(ps, &pi->ppd->PageSizes, PAGESIZE, entry)
{
TRACE("DC_PAPERNAMES: %s\n", debugstr_a(ps->FullName));
TRACE("DC_PAPERNAMES: %s\n", debugstr_w(ps->FullName));
i++;
if (output != NULL) {
MultiByteToWideChar(CP_ACP, 0, ps->FullName, -1, cp, 64);
lstrcpynW(cp, ps->FullName, 64);
cp += 64;
}
}
......
......@@ -28,6 +28,7 @@
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "winnls.h"
#include "wine/debug.h"
#include "psdrv.h"
......@@ -822,13 +823,17 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
tuple.option = NULL;
}
if(!page->FullName) {
int len;
if(tuple.opttrans) {
page->FullName = tuple.opttrans;
tuple.opttrans = NULL;
len = MultiByteToWideChar( CP_ACP, 0, tuple.opttrans, -1, NULL, 0 );
page->FullName = HeapAlloc( PSDRV_Heap, 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, tuple.opttrans, -1, page->FullName, len );
} else
{
page->FullName = HeapAlloc( PSDRV_Heap, 0, strlen(page->Name)+1 );
strcpy( page->FullName, page->Name );
len = MultiByteToWideChar( CP_ACP, 0, page->Name, -1, NULL, 0 );
page->FullName = HeapAlloc( PSDRV_Heap, 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, page->Name, -1, page->FullName, len );
}
}
if(!page->InvocationString) {
......@@ -871,8 +876,9 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
tuple.option = NULL;
}
if(!page->FullName) {
page->FullName = tuple.opttrans;
tuple.opttrans = NULL;
int len = MultiByteToWideChar( CP_ACP, 0, tuple.opttrans, -1, NULL, 0 );
page->FullName = HeapAlloc( PSDRV_Heap, 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, tuple.opttrans, -1, page->FullName, len );
}
#define PIA page->ImageableArea
......@@ -894,8 +900,9 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
tuple.option = NULL;
}
if(!page->FullName) {
page->FullName = tuple.opttrans;
tuple.opttrans = NULL;
int len = MultiByteToWideChar( CP_ACP, 0, tuple.opttrans, -1, NULL, 0 );
page->FullName = HeapAlloc( PSDRV_Heap, 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, tuple.opttrans, -1, page->FullName, len );
}
#define PD page->PaperDimension
......@@ -1026,7 +1033,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
{
if(!page->InvocationString || !page->PaperDimension)
{
WARN("Removing page %s since it has a missing %s entry\n", debugstr_a(page->FullName),
WARN("Removing page %s since it has a missing %s entry\n", debugstr_w(page->FullName),
page->InvocationString ? "PaperDimension" : "InvocationString");
HeapFree(PSDRV_Heap, 0, page->Name);
HeapFree(PSDRV_Heap, 0, page->FullName);
......@@ -1085,7 +1092,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
LIST_FOR_EACH_ENTRY(page, &ppd->PageSizes, PAGESIZE, entry) {
TRACE("'%s' aka '%s' (%d) invoked by '%s'\n", page->Name,
page->FullName, page->WinPage, page->InvocationString);
debugstr_w(page->FullName), page->WinPage, page->InvocationString);
if(page->ImageableArea)
TRACE("Area = %.2f,%.2f - %.2f, %.2f\n",
page->ImageableArea->llx, page->ImageableArea->lly,
......
......@@ -136,7 +136,7 @@ typedef struct {
typedef struct _tagPAGESIZE {
struct list entry;
char *Name;
char *FullName;
WCHAR *FullName;
char *InvocationString;
IMAGEABLEAREA *ImageableArea;
PAPERDIMENSION *PaperDimension;
......
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