From: Dmitry Timoshkov dmitry@baikal.ru
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57889 Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/prntvpt/ticket.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/prntvpt/ticket.c b/dlls/prntvpt/ticket.c index 7072f53102d..a73f535d79a 100644 --- a/dlls/prntvpt/ticket.c +++ b/dlls/prntvpt/ticket.c @@ -1503,7 +1503,7 @@ static inline int pixels_to_mm_x1000(int pixels, int dpi) return MulDiv(pixels, 25400, dpi); }
-static HRESULT write_PageImageableSize_caps(const WCHAR *device, IXMLDOMElement *root) +static HRESULT write_PageImageableSize_caps(const WCHAR *device, IXMLDOMElement *root, int orientation) { HRESULT hr; HDC hdc; @@ -1530,11 +1530,11 @@ static HRESULT write_PageImageableSize_caps(const WCHAR *device, IXMLDOMElement
hr = create_Property(page, L"psk:ImageableSizeWidth", &property); if (hr != S_OK) goto fail; - write_int_value(property, phys_width); + write_int_value(property, orientation == DMORIENT_PORTRAIT ? phys_width : phys_height); IXMLDOMElement_Release(property); hr = create_Property(page, L"psk:ImageableSizeHeight", &property); if (hr != S_OK) goto fail; - write_int_value(property, phys_height); + write_int_value(property, orientation == DMORIENT_PORTRAIT ? phys_height : phys_width); IXMLDOMElement_Release(property);
hr = create_Property(page, L"psk:ImageableArea", &area); @@ -1542,20 +1542,20 @@ static HRESULT write_PageImageableSize_caps(const WCHAR *device, IXMLDOMElement
hr = create_Property(area, L"psk:OriginWidth", &property); if (hr != S_OK) goto fail; - write_int_value(property, offset_x); + write_int_value(property, orientation == DMORIENT_PORTRAIT ? offset_x : offset_y); IXMLDOMElement_Release(property); hr = create_Property(area, L"psk:OriginHeight", &property); if (hr != S_OK) goto fail; - write_int_value(property, offset_y); + write_int_value(property, orientation == DMORIENT_PORTRAIT ? offset_y : offset_x); IXMLDOMElement_Release(property);
hr = create_Property(area, L"psk:ExtentWidth", &property); if (hr != S_OK) goto fail; - write_int_value(property, width); + write_int_value(property, orientation == DMORIENT_PORTRAIT ? width : height); IXMLDOMElement_Release(property); hr = create_Property(area, L"psk:ExtentHeight", &property); if (hr != S_OK) goto fail; - write_int_value(property, height); + write_int_value(property, orientation == DMORIENT_PORTRAIT ? height : width); IXMLDOMElement_Release(property);
IXMLDOMElement_Release(area); @@ -1732,7 +1732,7 @@ fail: return hr; }
-static HRESULT write_print_capabilities(const WCHAR *device, IStream *stream) +static HRESULT write_print_capabilities(const WCHAR *device, IStream *stream, int orientation) { static const char xmldecl[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"; HRESULT hr; @@ -1755,7 +1755,7 @@ static HRESULT write_print_capabilities(const WCHAR *device, IStream *stream)
hr = write_PageMediaSize_caps(device, root); if (hr != S_OK) goto fail; - hr = write_PageImageableSize_caps(device, root); + hr = write_PageImageableSize_caps(device, root, orientation); if (hr != S_OK) goto fail; hr = write_PageOutputColor_caps(device, root); if (hr != S_OK) goto fail; @@ -1799,7 +1799,7 @@ HRESULT WINAPI PTGetPrintCapabilities(HPTPROVIDER provider, IStream *stream, ISt hr = parse_ticket(stream, kPTJobScope, &ticket); if (hr != S_OK) return hr;
- return write_print_capabilities(prov->name, caps); + return write_print_capabilities(prov->name, caps, ticket.page.orientation); }
HRESULT WINAPI GetPrintCapabilitiesThunk2(HPTPROVIDER provider, BYTE *ticket, INT ticket_size,