Nikolay Sivov : msxml3: Use characters callback helper in one more place.

Alexandre Julliard julliard at winehq.org
Thu Mar 14 14:55:05 CDT 2013


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Mar 14 08:27:57 2013 +0400

msxml3: Use characters callback helper in one more place.

---

 dlls/msxml3/saxreader.c |   36 ++++++++++++++++--------------------
 1 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c
index 5475e1a..5a0b1c2 100644
--- a/dlls/msxml3/saxreader.c
+++ b/dlls/msxml3/saxreader.c
@@ -349,6 +349,21 @@ static inline int saxreader_has_handler(const saxlocator *locator, enum saxhandl
     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 */
 static const WCHAR PropertyCharsetW[] = {
     'c','h','a','r','s','e','t',0
@@ -1565,7 +1580,6 @@ static void libxmlCharacters(
         int len)
 {
     saxlocator *This = ctx;
-    struct saxcontenthandler_iface *handler = saxreader_get_contenthandler(This->saxreader);
     BSTR Chars;
     HRESULT hr;
     xmlChar *cur, *end;
@@ -1624,10 +1638,7 @@ static void libxmlCharacters(
         }
 
         Chars = pooled_bstr_from_xmlCharN(&This->saxreader->pool, cur, end-cur);
-        if(This->vbInterface)
-            hr = IVBSAXContentHandler_characters(handler->vbhandler, &Chars);
-        else
-            hr = ISAXContentHandler_characters(handler->handler, Chars, SysStringLen(Chars));
+        hr = saxreader_saxcharacters(This, Chars);
 
         if (sax_callback_failed(This, hr))
         {
@@ -1799,21 +1810,6 @@ static BSTR saxreader_get_cdata_chunk(const xmlChar *str, int len)
     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)
 {
     const xmlChar *start, *end;




More information about the wine-cvs mailing list