Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/prntvpt/ticket.c | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
diff --git a/dlls/prntvpt/ticket.c b/dlls/prntvpt/ticket.c index 1354d2e0f1..cc5e8e99ce 100644 --- a/dlls/prntvpt/ticket.c +++ b/dlls/prntvpt/ticket.c @@ -409,6 +409,48 @@ static void read_PageOrientation(IXMLDOMDocument2 *doc, struct ticket *ticket) IXMLDOMNode_Release(node); }
+static void read_DocumentCollate(IXMLDOMDocument2 *doc, struct ticket *ticket) +{ + IXMLDOMNode *node, *option; + HRESULT hr; + + hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:DocumentCollate']", &node); + if (hr != S_OK) return; + + hr = IXMLDOMNode_selectSingleNode(node, (BSTR)L"./psf:Option", &option); + if (hr == S_OK) + { + IXMLDOMElement *element; + + hr = IXMLDOMNode_QueryInterface(option, &IID_IXMLDOMElement, (void **)&element); + if (hr == S_OK) + { + VARIANT var; + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute(element, (BSTR)L"name", &var); + if (hr == S_OK && V_VT(&var) == VT_BSTR) + { + if (!wcscmp(V_BSTR(&var), L"psk:Collated")) + ticket->document.collate = DMCOLLATE_TRUE; + else if (!wcscmp(V_BSTR(&var), L"psk:Uncollated")) + ticket->document.collate = DMCOLLATE_FALSE; + else + { + FIXME("%s\n", wine_dbgstr_w(V_BSTR(&var))); + ticket->document.collate = DMCOLLATE_FALSE; + } + TRACE("document.collate: %s => %d\n", wine_dbgstr_w(V_BSTR(&var)), ticket->document.collate); + } + VariantClear(&var); + + IXMLDOMElement_Release(element); + } + } + + IXMLDOMNode_Release(node); +} + static void set_SelectionNamespaces(IXMLDOMDocument2 *doc) { IStream *stream; @@ -508,6 +550,9 @@ static HRESULT parse_ticket(IStream *stream, EPrintTicketScope scope, struct tic read_PageResolution(doc, ticket); read_PageOrientation(doc, ticket);
+ if (scope > kPTPageScope) + read_DocumentCollate(doc, ticket); + fail: IXMLDOMDocument2_Release(doc); return hr;