Commit f3ab228a authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msxml3: Fix checking if ContentHandler was set.

parent 03f79097
...@@ -908,7 +908,8 @@ static void libxmlStartDocument(void *ctx) ...@@ -908,7 +908,8 @@ static void libxmlStartDocument(void *ctx)
saxlocator *This = ctx; saxlocator *This = ctx;
HRESULT hr; HRESULT hr;
if(This->saxreader->contentHandler) if((This->vbInterface && This->saxreader->vbcontentHandler)
|| (!This->vbInterface && This->saxreader->contentHandler))
{ {
if(This->vbInterface) if(This->vbInterface)
hr = IVBSAXContentHandler_startDocument(This->saxreader->vbcontentHandler); hr = IVBSAXContentHandler_startDocument(This->saxreader->vbcontentHandler);
...@@ -932,7 +933,8 @@ static void libxmlEndDocument(void *ctx) ...@@ -932,7 +933,8 @@ static void libxmlEndDocument(void *ctx)
if(This->ret != S_OK) return; if(This->ret != S_OK) return;
if(This->saxreader->contentHandler) if((This->vbInterface && This->saxreader->vbcontentHandler)
|| (!This->vbInterface && This->saxreader->contentHandler))
{ {
if(This->vbInterface) if(This->vbInterface)
hr = IVBSAXContentHandler_endDocument(This->saxreader->vbcontentHandler); hr = IVBSAXContentHandler_endDocument(This->saxreader->vbcontentHandler);
...@@ -964,8 +966,8 @@ static void libxmlStartElementNS( ...@@ -964,8 +966,8 @@ static void libxmlStartElementNS(
update_position(This, (xmlChar*)This->pParserCtxt->input->cur+1); update_position(This, (xmlChar*)This->pParserCtxt->input->cur+1);
hr = namespacePush(This, nb_namespaces); hr = namespacePush(This, nb_namespaces);
if(hr==S_OK && ((This->vbInterface && This->saxreader->vbcontentHandler)
if(hr==S_OK && This->saxreader->contentHandler) || (!This->vbInterface && This->saxreader->contentHandler)))
{ {
for(index=0; index<nb_namespaces; index++) for(index=0; index<nb_namespaces; index++)
{ {
...@@ -1042,7 +1044,8 @@ static void libxmlEndElementNS( ...@@ -1042,7 +1044,8 @@ static void libxmlEndElementNS(
nsNr = namespacePop(This); nsNr = namespacePop(This);
if(This->saxreader->contentHandler) if((This->vbInterface && This->saxreader->vbcontentHandler)
|| (!This->vbInterface && This->saxreader->contentHandler))
{ {
NamespaceUri = bstr_from_xmlChar(URI); NamespaceUri = bstr_from_xmlChar(URI);
LocalName = bstr_from_xmlChar(localname); LocalName = bstr_from_xmlChar(localname);
...@@ -1120,7 +1123,8 @@ static void libxmlCharacters( ...@@ -1120,7 +1123,8 @@ static void libxmlCharacters(
lineCopy = This->line; lineCopy = This->line;
end = This->lastCur; end = This->lastCur;
if(This->saxreader->contentHandler) if((This->vbInterface && This->saxreader->vbcontentHandler)
|| (!This->vbInterface && This->saxreader->contentHandler))
{ {
while(This->lastCur < chEnd) while(This->lastCur < chEnd)
{ {
...@@ -1645,7 +1649,8 @@ static HRESULT WINAPI internal_getContentHandler( ...@@ -1645,7 +1649,8 @@ static HRESULT WINAPI internal_getContentHandler(
TRACE("(%p)->(%p)\n", This, pContentHandler); TRACE("(%p)->(%p)\n", This, pContentHandler);
if(pContentHandler == NULL) if(pContentHandler == NULL)
return E_POINTER; return E_POINTER;
if(This->contentHandler) if((vbInterface && This->vbcontentHandler)
|| (!vbInterface && This->contentHandler))
{ {
if(vbInterface) if(vbInterface)
IVBSAXContentHandler_AddRef(This->vbcontentHandler); IVBSAXContentHandler_AddRef(This->vbcontentHandler);
...@@ -1672,7 +1677,8 @@ static HRESULT WINAPI internal_putContentHandler( ...@@ -1672,7 +1677,8 @@ static HRESULT WINAPI internal_putContentHandler(
else else
ISAXContentHandler_AddRef((ISAXContentHandler*)contentHandler); ISAXContentHandler_AddRef((ISAXContentHandler*)contentHandler);
} }
if(This->contentHandler) if((vbInterface && This->vbcontentHandler)
|| (!vbInterface && This->contentHandler))
{ {
if(vbInterface) if(vbInterface)
IVBSAXContentHandler_Release(This->vbcontentHandler); IVBSAXContentHandler_Release(This->vbcontentHandler);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment