Commit 1d816be1 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Add support for standalone property.

parent 387966c4
......@@ -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);
......
......@@ -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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment