>From 525afb5a8fab2e1be46ee1251ea20b916584c9a4 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Fri, 23 Dec 2011 01:57:12 +0300
Subject: [PATCH 1/1] IXSL* implementations do not depend on libxml2

---
 dlls/msxml3/stylesheet.c |   35 ++++++++++++-----------------------
 1 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/dlls/msxml3/stylesheet.c b/dlls/msxml3/stylesheet.c
index 716ebba..5ee71af 100644
--- a/dlls/msxml3/stylesheet.c
+++ b/dlls/msxml3/stylesheet.c
@@ -40,9 +40,7 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
 
-#ifdef HAVE_LIBXML2
-
-typedef struct _xsltemplate
+typedef struct
 {
     DispatchEx dispex;
     IXSLTemplate IXSLTemplate_iface;
@@ -51,7 +49,7 @@ typedef struct _xsltemplate
     IXMLDOMNode *node;
 } xsltemplate;
 
-typedef struct _xslprocessor
+typedef struct
 {
     DispatchEx dispex;
     IXSLProcessor IXSLProcessor_iface;
@@ -115,15 +113,17 @@ static HRESULT WINAPI xsltemplate_QueryInterface(
 static ULONG WINAPI xsltemplate_AddRef( IXSLTemplate *iface )
 {
     xsltemplate *This = impl_from_IXSLTemplate( iface );
-    return InterlockedIncrement( &This->ref );
+    ULONG ref = InterlockedIncrement( &This->ref );
+    TRACE("(%p)->(%d)\n", This, ref);
+    return ref;
 }
 
 static ULONG WINAPI xsltemplate_Release( IXSLTemplate *iface )
 {
     xsltemplate *This = impl_from_IXSLTemplate( iface );
-    ULONG ref;
+    ULONG ref = InterlockedDecrement( &This->ref );
 
-    ref = InterlockedDecrement( &This->ref );
+    TRACE("(%p)->(%d)\n", This, ref);
     if ( ref == 0 )
     {
         if (This->node) IXMLDOMNode_Release( This->node );
@@ -220,7 +220,6 @@ static const struct IXSLTemplateVtbl XSLTemplateVtbl =
     xsltemplate_GetTypeInfo,
     xsltemplate_GetIDsOfNames,
     xsltemplate_Invoke,
-
     xsltemplate_putref_stylesheet,
     xsltemplate_get_stylesheet,
     xsltemplate_createProcessor
@@ -295,15 +294,17 @@ static HRESULT WINAPI xslprocessor_QueryInterface(
 static ULONG WINAPI xslprocessor_AddRef( IXSLProcessor *iface )
 {
     xslprocessor *This = impl_from_IXSLProcessor( iface );
-    return InterlockedIncrement( &This->ref );
+    ULONG ref = InterlockedIncrement( &This->ref );
+    TRACE("(%p)->(%d)\n", This, ref);
+    return ref;
 }
 
 static ULONG WINAPI xslprocessor_Release( IXSLProcessor *iface )
 {
     xslprocessor *This = impl_from_IXSLProcessor( iface );
-    ULONG ref;
+    ULONG ref = InterlockedDecrement( &This->ref );
 
-    ref = InterlockedDecrement( &This->ref );
+    TRACE("(%p)->(%d)\n", This, ref);
     if ( ref == 0 )
     {
         if (This->input) IXMLDOMNode_Release(This->input);
@@ -591,7 +592,6 @@ static const struct IXSLProcessorVtbl XSLProcessorVtbl =
     xslprocessor_GetTypeInfo,
     xslprocessor_GetIDsOfNames,
     xslprocessor_Invoke,
-
     xslprocessor_put_input,
     xslprocessor_get_input,
     xslprocessor_get_ownerTemplate,
@@ -645,14 +645,3 @@ HRESULT XSLProcessor_create(xsltemplate *template, IXSLProcessor **ppObj)
 
     return S_OK;
 }
-
-#else
-
-HRESULT XSLTemplate_create(IUnknown *pUnkOuter, void **ppObj)
-{
-    MESSAGE("This program tried to use a XSLTemplate object, but\n"
-            "libxml2 support was not present at compile time.\n");
-    return E_NOTIMPL;
-}
-
-#endif
-- 
1.5.6.5

