Nikolay Sivov : msxml3: Store boolean properties in a single array.

Alexandre Julliard julliard at winehq.org
Wed May 4 13:47:40 CDT 2011


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed May  4 10:59:32 2011 +0400

msxml3: Store boolean properties in a single array.

---

 dlls/msxml3/mxwriter.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c
index ec82611..b48533a 100644
--- a/dlls/msxml3/mxwriter.c
+++ b/dlls/msxml3/mxwriter.c
@@ -42,6 +42,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
 
 static const char crlfA[] = "\r\n";
 
+typedef enum
+{
+    MXWriter_Standalone = 0,
+    MXWriter_LastProp
+} MXWRITER_PROPS;
+
 typedef struct _mxwriter
 {
     IMXWriter IMXWriter_iface;
@@ -49,7 +55,7 @@ typedef struct _mxwriter
 
     LONG ref;
 
-    VARIANT_BOOL standalone;
+    VARIANT_BOOL props[MXWriter_LastProp];
     BSTR encoding;
     BSTR version;
 
@@ -320,7 +326,7 @@ static HRESULT WINAPI mxwriter_put_standalone(IMXWriter *iface, VARIANT_BOOL val
     mxwriter *This = impl_from_IMXWriter( iface );
 
     TRACE("(%p)->(%d)\n", This, value);
-    This->standalone = value;
+    This->props[MXWriter_Standalone] = value;
 
     return S_OK;
 }
@@ -333,7 +339,7 @@ static HRESULT WINAPI mxwriter_get_standalone(IMXWriter *iface, VARIANT_BOOL *va
 
     if (!value) return E_POINTER;
 
-    *value = This->standalone;
+    *value = This->props[MXWriter_Standalone];
 
     return S_OK;
 }
@@ -473,7 +479,7 @@ static HRESULT WINAPI mxwriter_saxcontent_startDocument(ISAXContentHandler *ifac
 
     /* standalone */
     xmlOutputBufferWriteString(This->buffer, " standalone=\"");
-    if (This->standalone == VARIANT_TRUE)
+    if (This->props[MXWriter_Standalone] == VARIANT_TRUE)
         xmlOutputBufferWriteString(This->buffer, "yes\"?>");
     else
         xmlOutputBufferWriteString(This->buffer, "no\"?>");
@@ -621,7 +627,7 @@ HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
     This->ISAXContentHandler_iface.lpVtbl = &mxwriter_saxcontent_vtbl;
     This->ref = 1;
 
-    This->standalone = VARIANT_FALSE;
+    This->props[MXWriter_Standalone] = VARIANT_FALSE;
     This->encoding   = SysAllocString(utf16W);
     This->version    = SysAllocString(version10W);
 




More information about the wine-cvs mailing list