Nikolay Sivov : msxml3: Support indent() property.

Alexandre Julliard julliard at winehq.org
Mon May 9 13:34:44 CDT 2011


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat May  7 20:53:33 2011 +0400

msxml3: Support indent() property.

---

 dlls/msxml3/mxwriter.c        |   25 ++++++++++++++++++-------
 dlls/msxml3/tests/saxreader.c |    8 ++++++++
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c
index a791acb..3d04ceb 100644
--- a/dlls/msxml3/mxwriter.c
+++ b/dlls/msxml3/mxwriter.c
@@ -44,7 +44,8 @@ static const char crlfA[] = "\r\n";
 
 typedef enum
 {
-    MXWriter_OmitXmlDecl = 0,
+    MXWriter_Indent = 0,
+    MXWriter_OmitXmlDecl,
     MXWriter_Standalone,
     MXWriter_LastProp
 } MXWRITER_PROPS;
@@ -308,18 +309,27 @@ static HRESULT WINAPI mxwriter_get_byteOrderMark(IMXWriter *iface, VARIANT_BOOL
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI mxwriter_put_indent(IMXWriter *iface, VARIANT_BOOL indent)
+static HRESULT WINAPI mxwriter_put_indent(IMXWriter *iface, VARIANT_BOOL value)
 {
     mxwriter *This = impl_from_IMXWriter( iface );
-    FIXME("(%p)->(%d)\n", This, indent);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%d)\n", This, value);
+    This->props[MXWriter_Indent] = value;
+
+    return S_OK;
 }
 
-static HRESULT WINAPI mxwriter_get_indent(IMXWriter *iface, VARIANT_BOOL *indent)
+static HRESULT WINAPI mxwriter_get_indent(IMXWriter *iface, VARIANT_BOOL *value)
 {
     mxwriter *This = impl_from_IMXWriter( iface );
-    FIXME("(%p)->(%p)\n", This, indent);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, value);
+
+    if (!value) return E_POINTER;
+
+    *value = This->props[MXWriter_Indent];
+
+    return S_OK;
 }
 
 static HRESULT WINAPI mxwriter_put_standalone(IMXWriter *iface, VARIANT_BOOL value)
@@ -698,6 +708,7 @@ HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
     This->ISAXContentHandler_iface.lpVtbl = &mxwriter_saxcontent_vtbl;
     This->ref = 1;
 
+    This->props[MXWriter_Indent] = VARIANT_FALSE;
     This->props[MXWriter_OmitXmlDecl] = VARIANT_FALSE;
     This->props[MXWriter_Standalone] = VARIANT_FALSE;
     This->encoding   = SysAllocString(utf16W);
diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c
index cac238c..fd07629 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_indent(writer, NULL);
+    ok(hr == E_POINTER, "got %08x\n", hr);
+
+    b = VARIANT_TRUE;
+    hr = IMXWriter_get_indent(writer, &b);
+    ok(hr == S_OK, "got %08x\n", hr);
+    ok(b == VARIANT_FALSE, "got %d\n", b);
+
     hr = IMXWriter_get_omitXMLDeclaration(writer, NULL);
     ok(hr == E_POINTER, "got %08x\n", hr);
 




More information about the wine-cvs mailing list