From 99daef624f59947537e5222c5ff47806c43f02be Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 17 Jun 2020 13:22:27 +0800 Subject: [PATCH] prntvpt: Add support for JobCopies to ticket XML writer. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/prntvpt/ticket.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dlls/prntvpt/ticket.c b/dlls/prntvpt/ticket.c index 591d61cb6ec..f012a16f7af 100644 --- a/dlls/prntvpt/ticket.c +++ b/dlls/prntvpt/ticket.c @@ -815,6 +815,16 @@ static HRESULT create_Option(IXMLDOMElement *root, const WCHAR *name, IXMLDOMEle return hr; } +static HRESULT create_ParameterInit(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) +{ + HRESULT hr; + + hr = create_element(root, L"psf:ParameterInit", child); + if (hr != S_OK) return hr; + + return add_attribute(*child, L"name", name); +} + static HRESULT create_ScoredProperty(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child) { HRESULT hr; @@ -971,6 +981,20 @@ static HRESULT write_JobInputBin(IXMLDOMElement *root, const struct ticket *tick return hr; } +static HRESULT write_JobCopies(IXMLDOMElement *root, const struct ticket *ticket) +{ + IXMLDOMElement *parameter; + HRESULT hr; + + hr = create_ParameterInit(root, L"psk:JobCopiesAllDocuments", ¶meter); + if (hr != S_OK) return hr; + + hr = write_int_value(parameter, ticket->job.copies); + + IXMLDOMElement_Release(parameter); + return hr; +} + static HRESULT write_attributes(IXMLDOMElement *element) { HRESULT hr; @@ -1029,6 +1053,8 @@ static HRESULT write_ticket(IStream *stream, const struct ticket *ticket, EPrint { hr = write_JobInputBin(root, ticket); if (hr != S_OK) goto fail; + hr = write_JobCopies(root, ticket); + if (hr != S_OK) goto fail; } hr = IStream_Write(stream, xmldecl, strlen(xmldecl), NULL);