prntvpt: Add support for DocumentCollate to ticket XML writer.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-06-17 13:22:17 +08:00 committed by Alexandre Julliard
parent f81aef7243
commit 10e37819aa
1 changed files with 24 additions and 0 deletions

View File

@ -935,6 +935,24 @@ static HRESULT write_PageOrientation(IXMLDOMElement *root, const struct ticket *
return hr;
}
static HRESULT write_DocumentCollate(IXMLDOMElement *root, const struct ticket *ticket)
{
IXMLDOMElement *feature, *option = NULL;
HRESULT hr;
hr = create_Feature(root, L"psk:DocumentCollate", &feature);
if (hr != S_OK) return hr;
if (ticket->document.collate == DMCOLLATE_TRUE)
hr = create_Option(feature, L"psk:Collated", &option);
else /* DMCOLLATE_FALSE */
hr = create_Option(feature, L"psk:Uncollated", &option);
if (option) IXMLDOMElement_Release(option);
IXMLDOMElement_Release(feature);
return hr;
}
static HRESULT write_attributes(IXMLDOMElement *element)
{
HRESULT hr;
@ -983,6 +1001,12 @@ static HRESULT write_ticket(IStream *stream, const struct ticket *ticket, EPrint
hr = write_PageOrientation(root, ticket);
if (hr != S_OK) goto fail;
if (scope >= kPTDocumentScope)
{
hr = write_DocumentCollate(root, ticket);
if (hr != S_OK) goto fail;
}
hr = IStream_Write(stream, xmldecl, strlen(xmldecl), NULL);
if (hr != S_OK) goto fail;