From 53efed9112af40656c0f0fbe820fb460310a81c7 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 7 May 2011 22:15:33 +0400 Subject: [PATCH] msxml3: Support get/set for disableOutputEscaping() property. --- dlls/msxml3/mxwriter.c | 19 +++++++++++++++---- dlls/msxml3/tests/saxreader.c | 8 ++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index 0bf1146d331..2a354aca59f 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -45,6 +45,7 @@ static const char crlfA[] = "\r\n"; typedef enum { MXWriter_BOM = 0, + MXWriter_DisableEscaping, MXWriter_Indent, MXWriter_OmitXmlDecl, MXWriter_Standalone, @@ -409,15 +410,24 @@ static HRESULT WINAPI mxwriter_get_version(IMXWriter *iface, BSTR *version) static HRESULT WINAPI mxwriter_put_disableOutputEscaping(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->props[MXWriter_DisableEscaping] = value; + + return S_OK; } static HRESULT WINAPI mxwriter_get_disableOutputEscaping(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->props[MXWriter_DisableEscaping]; + + return S_OK; } static HRESULT WINAPI mxwriter_flush(IMXWriter *iface) @@ -730,6 +740,7 @@ HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj) This->ref = 1; This->props[MXWriter_BOM] = VARIANT_TRUE; + This->props[MXWriter_DisableEscaping] = VARIANT_FALSE; This->props[MXWriter_Indent] = VARIANT_FALSE; This->props[MXWriter_OmitXmlDecl] = VARIANT_FALSE; This->props[MXWriter_Standalone] = VARIANT_FALSE; diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 8ad464faa01..ec1c1ec37dd 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -936,6 +936,14 @@ static void test_mxwriter_properties(void) &IID_IMXWriter, (void**)&writer); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + hr = IMXWriter_get_disableOutputEscaping(writer, NULL); + ok(hr == E_POINTER, "got %08x\n", hr); + + b = VARIANT_TRUE; + hr = IMXWriter_get_disableOutputEscaping(writer, &b); + ok(hr == S_OK, "got %08x\n", hr); + ok(b == VARIANT_FALSE, "got %d\n", b); + hr = IMXWriter_get_byteOrderMark(writer, NULL); ok(hr == E_POINTER, "got %08x\n", hr);