Dmitry Timoshkov : prntvpt: Add support for DocumentCollate to ticket XML writer.

Alexandre Julliard julliard at winehq.org
Wed Jun 17 15:54:00 CDT 2020


Module: wine
Branch: master
Commit: 10e37819aa31b3eb70cbea31ad75007452f0e81e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=10e37819aa31b3eb70cbea31ad75007452f0e81e

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Wed Jun 17 13:22:17 2020 +0800

prntvpt: Add support for DocumentCollate to ticket XML writer.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/prntvpt/ticket.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/dlls/prntvpt/ticket.c b/dlls/prntvpt/ticket.c
index 13b5ad4ed4..a3b3f6a0ed 100644
--- a/dlls/prntvpt/ticket.c
+++ b/dlls/prntvpt/ticket.c
@@ -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;
 




More information about the wine-cvs mailing list