prntvpt: Add support for JobInputBin to ticket XML reader.

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-11 13:59:46 +08:00 committed by Alexandre Julliard
parent f3872c7664
commit 365cfcd482
1 changed files with 45 additions and 0 deletions

View File

@ -451,6 +451,46 @@ static void read_DocumentCollate(IXMLDOMDocument2 *doc, struct ticket *ticket)
IXMLDOMNode_Release(node);
}
static void read_JobInputBin(IXMLDOMDocument2 *doc, struct ticket *ticket)
{
IXMLDOMNode *node, *option;
HRESULT hr;
hr = IXMLDOMDocument2_selectSingleNode(doc, (BSTR)L"psf:PrintTicket/psf:Feature[@name='psk:JobInputBin']", &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:AutoSelect"))
ticket->job.input_bin = DMBIN_AUTO;
else
{
FIXME("%s\n", wine_dbgstr_w(V_BSTR(&var)));
ticket->job.input_bin = DMBIN_AUTO;
}
TRACE("input_bin: %s => %d\n", wine_dbgstr_w(V_BSTR(&var)), ticket->job.input_bin);
}
VariantClear(&var);
IXMLDOMElement_Release(element);
}
}
IXMLDOMNode_Release(node);
}
static void set_SelectionNamespaces(IXMLDOMDocument2 *doc)
{
IStream *stream;
@ -553,6 +593,11 @@ static HRESULT parse_ticket(IStream *stream, EPrintTicketScope scope, struct tic
if (scope > kPTPageScope)
read_DocumentCollate(doc, ticket);
if (scope > kPTDocumentScope)
{
read_JobInputBin(doc, ticket);
}
fail:
IXMLDOMDocument2_Release(doc);
return hr;