mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:43:31 +00:00
msxml3: Correct IXMLDOMProcessingInstruction_put_data function.
This commit is contained in:
parent
ad606f4d26
commit
c61937b6d4
2 changed files with 16 additions and 13 deletions
|
@ -506,9 +506,24 @@ static HRESULT WINAPI dom_pi_put_data(
|
|||
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
|
||||
HRESULT hr = E_FAIL;
|
||||
VARIANT val;
|
||||
BSTR sTarget;
|
||||
static WCHAR szXML[] = {'x','m','l',0};
|
||||
|
||||
TRACE("%p %s\n", This, debugstr_w(data) );
|
||||
|
||||
/* Cannot set data to a PI node whos target is 'xml' */
|
||||
hr = dom_pi_get_nodeName(iface, &sTarget);
|
||||
if(hr == S_OK)
|
||||
{
|
||||
if(lstrcmpW( sTarget, szXML) == 0)
|
||||
{
|
||||
SysFreeString(sTarget);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
SysFreeString(sTarget);
|
||||
}
|
||||
|
||||
V_VT(&val) = VT_BSTR;
|
||||
V_BSTR(&val) = data;
|
||||
|
||||
|
|
|
@ -682,19 +682,7 @@ static void test_domdoc( void )
|
|||
|
||||
/* test put_data */
|
||||
r = IXMLDOMProcessingInstruction_put_data(nodePI, _bstr_("version=\"1.0\" encoding=\"UTF-8\""));
|
||||
ok(r == S_OK, "ret %08x\n", r );
|
||||
SysFreeString(str);
|
||||
|
||||
r = IXMLDOMProcessingInstruction_get_data(nodePI, &str);
|
||||
ok(r == S_OK, "ret %08x\n", r );
|
||||
ok( !lstrcmpW( str, _bstr_("version=\"1.0\" encoding=\"UTF-8\"") ), "incorrect data string\n");
|
||||
SysFreeString(str);
|
||||
|
||||
/* Confirm XML text is good */
|
||||
r = IXMLDOMProcessingInstruction_get_xml(nodePI, &str);
|
||||
ok(r == S_OK, "ret %08x\n", r );
|
||||
ok( !lstrcmpW( str, _bstr_("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") ), "incorrect xml string\n");
|
||||
SysFreeString(str);
|
||||
ok(r == E_FAIL, "ret %08x\n", r );
|
||||
|
||||
IXMLDOMProcessingInstruction_Release(nodePI);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue