msxml3: Add support for standalone property.

This commit is contained in:
Nikolay Sivov 2011-04-30 15:36:37 +04:00 committed by Alexandre Julliard
parent 387966c48a
commit 1d816be12e
2 changed files with 53 additions and 4 deletions

View File

@ -44,6 +44,8 @@ typedef struct _mxwriter
ISAXContentHandler ISAXContentHandler_iface;
LONG ref;
VARIANT_BOOL standalone;
} mxwriter;
static inline mxwriter *impl_from_IMXWriter(IMXWriter *iface)
@ -237,15 +239,24 @@ static HRESULT WINAPI mxwriter_get_indent(IMXWriter *iface, VARIANT_BOOL *indent
static HRESULT WINAPI mxwriter_put_standalone(IMXWriter *iface, VARIANT_BOOL value)
{
mxwriter *This = impl_from_IMXWriter( iface );
FIXME("(%p)->(%d)\n", This, value);
return E_NOTIMPL;
TRACE("(%p)->(%d)\n", This, value);
This->standalone = value;
return S_OK;
}
static HRESULT WINAPI mxwriter_get_standalone(IMXWriter *iface, VARIANT_BOOL *value)
{
mxwriter *This = impl_from_IMXWriter( iface );
FIXME("(%p)->(%p)\n", This, value);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, value);
if (!value) return E_POINTER;
*value = This->standalone;
return S_OK;
}
static HRESULT WINAPI mxwriter_put_omitXMLDeclaration(IMXWriter *iface, VARIANT_BOOL value)
@ -499,6 +510,8 @@ HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
This->ISAXContentHandler_iface.lpVtbl = &mxwriter_saxcontent_vtbl;
This->ref = 1;
This->standalone = VARIANT_FALSE;
*ppObj = &This->IMXWriter_iface;
TRACE("returning iface %p\n", *ppObj);

View File

@ -694,6 +694,41 @@ static void test_mxwriter_contenthandler(void)
IMXWriter_Release(writer);
}
static void test_mxwriter_properties(void)
{
IMXWriter *writer;
VARIANT_BOOL b;
HRESULT hr;
hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER,
&IID_IMXWriter, (void**)&writer);
if (hr != S_OK)
{
win_skip("MXXMLWriter not supported\n");
return;
}
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
hr = IMXWriter_get_standalone(writer, NULL);
ok(hr == E_POINTER, "got %08x\n", hr);
b = VARIANT_TRUE;
hr = IMXWriter_get_standalone(writer, &b);
ok(hr == S_OK, "got %08x\n", hr);
ok(b == VARIANT_FALSE, "got %d\n", b);
/* set and check */
hr = IMXWriter_put_standalone(writer, VARIANT_TRUE);
ok(hr == S_OK, "got %08x\n", hr);
b = VARIANT_FALSE;
hr = IMXWriter_get_standalone(writer, &b);
ok(hr == S_OK, "got %08x\n", hr);
ok(b == VARIANT_TRUE, "got %d\n", b);
IMXWriter_Release(writer);
}
START_TEST(saxreader)
{
ISAXXMLReader *reader;
@ -716,6 +751,7 @@ START_TEST(saxreader)
test_saxreader();
test_encoding();
test_mxwriter_contenthandler();
test_mxwriter_properties();
CoUninitialize();
}