prntvpt: Add support for custom scaling 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:
parent
99daef624f
commit
642e82eddf
|
@ -825,6 +825,16 @@ static HRESULT create_ParameterInit(IXMLDOMElement *root, const WCHAR *name, IXM
|
||||||
return add_attribute(*child, L"name", name);
|
return add_attribute(*child, L"name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT create_ParameterRef(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child)
|
||||||
|
{
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
|
hr = create_element(root, L"psf:ParameterRef", 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)
|
static HRESULT create_ScoredProperty(IXMLDOMElement *root, const WCHAR *name, IXMLDOMElement **child)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -889,12 +899,41 @@ static HRESULT write_PageScaling(IXMLDOMElement *root, const struct ticket *tick
|
||||||
hr = create_Feature(root, L"psk:PageScaling", &feature);
|
hr = create_Feature(root, L"psk:PageScaling", &feature);
|
||||||
if (hr != S_OK) return hr;
|
if (hr != S_OK) return hr;
|
||||||
|
|
||||||
if (ticket->page.scaling != 100)
|
if (ticket->page.scaling == 100)
|
||||||
FIXME("page.scaling: %d\n", ticket->page.scaling);
|
{
|
||||||
|
hr = create_Option(feature, L"psk:None", &option);
|
||||||
|
if (hr == S_OK) IXMLDOMElement_Release(option);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hr = create_Option(feature, L"psk:CustomSquare", &option);
|
||||||
|
if (hr == S_OK)
|
||||||
|
{
|
||||||
|
IXMLDOMElement *property, *parameter;
|
||||||
|
|
||||||
hr = create_Option(feature, L"psk:None", &option);
|
hr = create_ScoredProperty(option, L"psk:Scale", &property);
|
||||||
|
if (hr == S_OK)
|
||||||
|
{
|
||||||
|
hr = create_ParameterRef(property, L"psk:PageScalingScale", ¶meter);
|
||||||
|
if (hr == S_OK)
|
||||||
|
{
|
||||||
|
IXMLDOMElement_Release(parameter);
|
||||||
|
|
||||||
|
hr = create_ParameterInit(root, L"psk:PageScalingScale", ¶meter);
|
||||||
|
if (hr == S_OK)
|
||||||
|
{
|
||||||
|
hr = write_int_value(parameter, ticket->page.scaling);
|
||||||
|
IXMLDOMElement_Release(parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IXMLDOMElement_Release(property);
|
||||||
|
}
|
||||||
|
|
||||||
|
IXMLDOMElement_Release(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (option) IXMLDOMElement_Release(option);
|
|
||||||
IXMLDOMElement_Release(feature);
|
IXMLDOMElement_Release(feature);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue