msxml3: Implement get_nodeTypedValue() for nodes that can't have type.

This commit is contained in:
Nikolay Sivov 2011-03-07 00:39:13 +03:00 committed by Alexandre Julliard
parent 0f3c247e46
commit 46fa479105
7 changed files with 92 additions and 19 deletions

View File

@ -433,11 +433,11 @@ static HRESULT WINAPI domcdata_get_definition(
static HRESULT WINAPI domcdata_get_nodeTypedValue( static HRESULT WINAPI domcdata_get_nodeTypedValue(
IXMLDOMCDATASection *iface, IXMLDOMCDATASection *iface,
VARIANT* var1) VARIANT* v)
{ {
domcdata *This = impl_from_IXMLDOMCDATASection( iface ); domcdata *This = impl_from_IXMLDOMCDATASection( iface );
FIXME("(%p)->(%p)\n", This, var1); TRACE("(%p)->(%p)\n", This, v);
return return_null_var(var1); return node_get_content(&This->node, v);
} }
static HRESULT WINAPI domcdata_put_nodeTypedValue( static HRESULT WINAPI domcdata_put_nodeTypedValue(

View File

@ -432,11 +432,11 @@ static HRESULT WINAPI domcomment_get_definition(
static HRESULT WINAPI domcomment_get_nodeTypedValue( static HRESULT WINAPI domcomment_get_nodeTypedValue(
IXMLDOMComment *iface, IXMLDOMComment *iface,
VARIANT* var1) VARIANT* v)
{ {
domcomment *This = impl_from_IXMLDOMComment( iface ); domcomment *This = impl_from_IXMLDOMComment( iface );
FIXME("(%p)->(%p)\n", This, var1); TRACE("(%p)->(%p)\n", This, v);
return return_null_var(var1); return node_get_content(&This->node, v);
} }
static HRESULT WINAPI domcomment_put_nodeTypedValue( static HRESULT WINAPI domcomment_put_nodeTypedValue(

View File

@ -436,11 +436,11 @@ static HRESULT WINAPI domfrag_get_definition(
static HRESULT WINAPI domfrag_get_nodeTypedValue( static HRESULT WINAPI domfrag_get_nodeTypedValue(
IXMLDOMDocumentFragment *iface, IXMLDOMDocumentFragment *iface,
VARIANT* var1) VARIANT *v)
{ {
domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
FIXME("(%p)->(%p)\n", This, var1); TRACE("(%p)->(%p)\n", This, v);
return return_null_var(var1); return return_null_var(v);
} }
static HRESULT WINAPI domfrag_put_nodeTypedValue( static HRESULT WINAPI domfrag_put_nodeTypedValue(

View File

@ -407,11 +407,11 @@ static HRESULT WINAPI domdoctype_get_definition(
static HRESULT WINAPI domdoctype_get_nodeTypedValue( static HRESULT WINAPI domdoctype_get_nodeTypedValue(
IXMLDOMDocumentType *iface, IXMLDOMDocumentType *iface,
VARIANT* var1) VARIANT* v)
{ {
domdoctype *This = impl_from_IXMLDOMDocumentType( iface ); domdoctype *This = impl_from_IXMLDOMDocumentType( iface );
FIXME("(%p)->(%p): stub\n", This, var1); TRACE("(%p)->(%p)\n", This, v);
return E_NOTIMPL; return return_null_var(v);
} }
static HRESULT WINAPI domdoctype_put_nodeTypedValue( static HRESULT WINAPI domdoctype_put_nodeTypedValue(

View File

@ -1328,11 +1328,11 @@ static HRESULT WINAPI domdoc_get_definition(
static HRESULT WINAPI domdoc_get_nodeTypedValue( static HRESULT WINAPI domdoc_get_nodeTypedValue(
IXMLDOMDocument3 *iface, IXMLDOMDocument3 *iface,
VARIANT* typedValue ) VARIANT* v )
{ {
domdoc *This = impl_from_IXMLDOMDocument3( iface ); domdoc *This = impl_from_IXMLDOMDocument3( iface );
FIXME("(%p)->(%p)\n", This, typedValue); TRACE("(%p)->(%p)\n", This, v);
return return_null_var(typedValue); return return_null_var(v);
} }
static HRESULT WINAPI domdoc_put_nodeTypedValue( static HRESULT WINAPI domdoc_put_nodeTypedValue(

View File

@ -447,11 +447,11 @@ static HRESULT WINAPI dom_pi_get_definition(
static HRESULT WINAPI dom_pi_get_nodeTypedValue( static HRESULT WINAPI dom_pi_get_nodeTypedValue(
IXMLDOMProcessingInstruction *iface, IXMLDOMProcessingInstruction *iface,
VARIANT* var1) VARIANT* v)
{ {
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
FIXME("(%p)->(%p)\n", This, var1); TRACE("(%p)->(%p)\n", This, v);
return return_null_var(var1); return node_get_content(&This->node, v);
} }
static HRESULT WINAPI dom_pi_put_nodeTypedValue( static HRESULT WINAPI dom_pi_put_nodeTypedValue(

View File

@ -6009,7 +6009,12 @@ static const nodetypedvalue_t get_nodetypedvalue[] = {
static void test_nodeTypedValue(void) static void test_nodeTypedValue(void)
{ {
const nodetypedvalue_t *entry = get_nodetypedvalue; const nodetypedvalue_t *entry = get_nodetypedvalue;
IXMLDOMDocument *doc; IXMLDOMProcessingInstruction *pi;
IXMLDOMDocumentFragment *frag;
IXMLDOMDocumentType *doctype;
IXMLDOMDocument *doc, *doc2;
IXMLDOMCDATASection *cdata;
IXMLDOMComment *comment;
IXMLDOMNode *node; IXMLDOMNode *node;
VARIANT_BOOL b; VARIANT_BOOL b;
VARIANT value; VARIANT value;
@ -6035,8 +6040,10 @@ static void test_nodeTypedValue(void)
hr = IXMLDOMDocument_get_nodeTypedValue(doc, NULL); hr = IXMLDOMDocument_get_nodeTypedValue(doc, NULL);
ok(hr == E_INVALIDARG, "ret %08x\n", hr ); ok(hr == E_INVALIDARG, "ret %08x\n", hr );
V_VT(&value) = VT_EMPTY;
hr = IXMLDOMDocument_get_nodeTypedValue(doc, &value); hr = IXMLDOMDocument_get_nodeTypedValue(doc, &value);
ok(hr == S_FALSE, "ret %08x\n", hr ); ok(hr == S_FALSE, "ret %08x\n", hr );
ok(V_VT(&value) == VT_NULL, "got %d\n", V_VT(&value));
hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_("root/string"), &node); hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_("root/string"), &node);
ok(hr == S_OK, "ret %08x\n", hr ); ok(hr == S_OK, "ret %08x\n", hr );
@ -6082,6 +6089,72 @@ static void test_nodeTypedValue(void)
IXMLDOMNode_Release(node); IXMLDOMNode_Release(node);
} }
hr = IXMLDOMDocument_createProcessingInstruction(doc, _bstr_("foo"), _bstr_("value"), &pi);
ok(hr == S_OK, "ret %08x\n", hr );
{
V_VT(&value) = VT_NULL;
V_BSTR(&value) = (void*)0xdeadbeef;
hr = IXMLDOMProcessingInstruction_get_nodeTypedValue(pi, &value);
ok(hr == S_OK, "ret %08x\n", hr );
ok(V_VT(&value) == VT_BSTR, "got %d\n", V_VT(&value));
ok(!lstrcmpW(V_BSTR(&value), _bstr_("value")), "got wrong value\n");
IXMLDOMProcessingInstruction_Release(pi);
}
hr = IXMLDOMDocument_createCDATASection(doc, _bstr_("[1]*2=3; &gee thats not right!"), &cdata);
ok(hr == S_OK, "ret %08x\n", hr );
{
V_VT(&value) = VT_NULL;
V_BSTR(&value) = (void*)0xdeadbeef;
hr = IXMLDOMCDATASection_get_nodeTypedValue(cdata, &value);
ok(hr == S_OK, "ret %08x\n", hr );
ok(V_VT(&value) == VT_BSTR, "got %d\n", V_VT(&value));
ok(!lstrcmpW(V_BSTR(&value), _bstr_("[1]*2=3; &gee thats not right!")), "got wrong value\n");
IXMLDOMCDATASection_Release(cdata);
}
hr = IXMLDOMDocument_createComment(doc, _bstr_("comment"), &comment);
ok(hr == S_OK, "ret %08x\n", hr );
{
V_VT(&value) = VT_NULL;
V_BSTR(&value) = (void*)0xdeadbeef;
hr = IXMLDOMComment_get_nodeTypedValue(comment, &value);
ok(hr == S_OK, "ret %08x\n", hr );
ok(V_VT(&value) == VT_BSTR, "got %d\n", V_VT(&value));
ok(!lstrcmpW(V_BSTR(&value), _bstr_("comment")), "got wrong value\n");
IXMLDOMComment_Release(comment);
}
hr = IXMLDOMDocument_createDocumentFragment(doc, &frag);
ok(hr == S_OK, "ret %08x\n", hr );
{
V_VT(&value) = VT_EMPTY;
hr = IXMLDOMDocumentFragment_get_nodeTypedValue(frag, &value);
ok(hr == S_FALSE, "ret %08x\n", hr );
ok(V_VT(&value) == VT_NULL, "got %d\n", V_VT(&value));
IXMLDOMDocumentFragment_Release(frag);
}
doc2 = create_document(&IID_IXMLDOMDocument);
b = VARIANT_FALSE;
hr = IXMLDOMDocument_loadXML(doc2, _bstr_(szEmailXML), &b);
ok(hr == S_OK, "ret %08x\n", hr );
ok(b == VARIANT_TRUE, "got %d\n", b);
hr = IXMLDOMDocument_get_doctype(doc2, &doctype);
todo_wine ok(hr == S_OK, "ret %08x\n", hr );
if (hr == S_OK)
{
V_VT(&value) = VT_EMPTY;
hr = IXMLDOMDocumentType_get_nodeTypedValue(doctype, &value);
ok(hr == S_FALSE, "ret %08x\n", hr );
ok(V_VT(&value) == VT_NULL, "got %d\n", V_VT(&value));
IXMLDOMDocumentType_Release(doctype);
}
IXMLDOMDocument_Release(doc2);
while (entry->name) while (entry->name)
{ {
hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_(entry->name), &node); hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_(entry->name), &node);