[PATCH v2 04/12] prntvpt: Add support for PageResolution to ticket XML writer.
Dmitry Timoshkov
dmitry at baikal.ru
Wed Jun 17 00:22:09 CDT 2020
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
dlls/prntvpt/ticket.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/dlls/prntvpt/ticket.c b/dlls/prntvpt/ticket.c
index e90dc5100b..b9dfdb10ae 100644
--- a/dlls/prntvpt/ticket.c
+++ b/dlls/prntvpt/ticket.c
@@ -889,6 +889,34 @@ static HRESULT write_PageScaling(IXMLDOMElement *root, const struct ticket *tick
return hr;
}
+static HRESULT write_PageResolution(IXMLDOMElement *root, const struct ticket *ticket)
+{
+ IXMLDOMElement *feature, *option = NULL, *property;
+ HRESULT hr;
+
+ hr = create_Feature(root, L"psk:PageResolution", &feature);
+ if (hr != S_OK) return hr;
+
+ hr = create_Option(feature, NULL, &option);
+ if (hr != S_OK) goto fail;
+
+ hr = create_ScoredProperty(option, L"psk:ResolutionX", &property);
+ if (hr != S_OK) goto fail;
+ hr = write_int_value(property, ticket->page.resolution.x);
+ IXMLDOMElement_Release(property);
+ if (hr != S_OK) goto fail;
+
+ hr = create_ScoredProperty(option, L"psk:ResolutionY", &property);
+ if (hr != S_OK) goto fail;
+ hr = write_int_value(property, ticket->page.resolution.y);
+ IXMLDOMElement_Release(property);
+
+fail:
+ if (option) IXMLDOMElement_Release(option);
+ IXMLDOMElement_Release(feature);
+ return hr;
+}
+
static HRESULT write_attributes(IXMLDOMElement *element)
{
HRESULT hr;
@@ -932,6 +960,8 @@ static HRESULT write_ticket(IStream *stream, const struct ticket *ticket, EPrint
if (hr != S_OK) goto fail;
hr = write_PageScaling(root, ticket);
if (hr != S_OK) goto fail;
+ hr = write_PageResolution(root, ticket);
+ if (hr != S_OK) goto fail;
hr = IStream_Write(stream, xmldecl, strlen(xmldecl), NULL);
if (hr != S_OK) goto fail;
--
2.26.2
More information about the wine-devel
mailing list