Commit 81ffe043 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Use characters callback helper in one more place.

parent 7993bd3d
...@@ -349,6 +349,21 @@ static inline int saxreader_has_handler(const saxlocator *locator, enum saxhandl ...@@ -349,6 +349,21 @@ static inline int saxreader_has_handler(const saxlocator *locator, enum saxhandl
return (locator->vbInterface && iface->vbhandler) || (!locator->vbInterface && iface->handler); return (locator->vbInterface && iface->vbhandler) || (!locator->vbInterface && iface->handler);
} }
static HRESULT saxreader_saxcharacters(saxlocator *locator, BSTR chars)
{
struct saxcontenthandler_iface *content = saxreader_get_contenthandler(locator->saxreader);
HRESULT hr;
if (!saxreader_has_handler(locator, SAXContentHandler)) return S_OK;
if (locator->vbInterface)
hr = IVBSAXContentHandler_characters(content->vbhandler, &chars);
else
hr = ISAXContentHandler_characters(content->handler, chars, SysStringLen(chars));
return hr;
}
/* property names */ /* property names */
static const WCHAR PropertyCharsetW[] = { static const WCHAR PropertyCharsetW[] = {
'c','h','a','r','s','e','t',0 'c','h','a','r','s','e','t',0
...@@ -1565,7 +1580,6 @@ static void libxmlCharacters( ...@@ -1565,7 +1580,6 @@ static void libxmlCharacters(
int len) int len)
{ {
saxlocator *This = ctx; saxlocator *This = ctx;
struct saxcontenthandler_iface *handler = saxreader_get_contenthandler(This->saxreader);
BSTR Chars; BSTR Chars;
HRESULT hr; HRESULT hr;
xmlChar *cur, *end; xmlChar *cur, *end;
...@@ -1624,10 +1638,7 @@ static void libxmlCharacters( ...@@ -1624,10 +1638,7 @@ static void libxmlCharacters(
} }
Chars = pooled_bstr_from_xmlCharN(&This->saxreader->pool, cur, end-cur); Chars = pooled_bstr_from_xmlCharN(&This->saxreader->pool, cur, end-cur);
if(This->vbInterface) hr = saxreader_saxcharacters(This, Chars);
hr = IVBSAXContentHandler_characters(handler->vbhandler, &Chars);
else
hr = ISAXContentHandler_characters(handler->handler, Chars, SysStringLen(Chars));
if (sax_callback_failed(This, hr)) if (sax_callback_failed(This, hr))
{ {
...@@ -1799,21 +1810,6 @@ static BSTR saxreader_get_cdata_chunk(const xmlChar *str, int len) ...@@ -1799,21 +1810,6 @@ static BSTR saxreader_get_cdata_chunk(const xmlChar *str, int len)
return ret; return ret;
} }
static HRESULT saxreader_saxcharacters(saxlocator *locator, BSTR chars)
{
struct saxcontenthandler_iface *content = saxreader_get_contenthandler(locator->saxreader);
HRESULT hr;
if (!saxreader_has_handler(locator, SAXContentHandler)) return S_OK;
if (locator->vbInterface)
hr = IVBSAXContentHandler_characters(content->vbhandler, &chars);
else
hr = ISAXContentHandler_characters(content->handler, chars, SysStringLen(chars));
return hr;
}
static void libxml_cdatablock(void *ctx, const xmlChar *value, int len) static void libxml_cdatablock(void *ctx, const xmlChar *value, int len)
{ {
const xmlChar *start, *end; const xmlChar *start, *end;
......
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