Nikolay Sivov : msxml3: Add support for standalone property.

Alexandre Julliard julliard at winehq.org
Mon May 2 14:16:15 CDT 2011


Module: wine
Branch: master
Commit: 1d816be12e48e8c5cf7adca2194f946ff55346d3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1d816be12e48e8c5cf7adca2194f946ff55346d3

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat Apr 30 15:36:37 2011 +0400

msxml3: Add support for standalone property.

---

 dlls/msxml3/mxwriter.c        |   21 +++++++++++++++++----
 dlls/msxml3/tests/saxreader.c |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c
index 6cebf76..fed2fda 100644
--- a/dlls/msxml3/mxwriter.c
+++ b/dlls/msxml3/mxwriter.c
@@ -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);
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index f6c35b8..784b37a 100644
--- a/dlls/msxml3/tests/saxreader.c
+++ b/dlls/msxml3/tests/saxreader.c
@@ -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();
 }




More information about the wine-cvs mailing list