Nikolay Sivov : msxml3: Build qualified name using libxml2 helper.

Alexandre Julliard julliard at winehq.org
Fri Oct 29 10:58:19 CDT 2010


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Oct 29 01:14:08 2010 +0400

msxml3: Build qualified name using libxml2 helper.

---

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

diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c
index 1fdf48d..fd461d1 100644
--- a/dlls/msxml3/saxreader.c
+++ b/dlls/msxml3/saxreader.c
@@ -182,23 +182,17 @@ static BSTR bstr_from_xmlCharN(const xmlChar *buf, int len)
 
 static BSTR QName_from_xmlChar(const xmlChar *prefix, const xmlChar *name)
 {
-    DWORD dLen, dLast;
+    xmlChar *qname;
     BSTR bstr;
 
     if(!name) return NULL;
 
-    if(!prefix || *prefix=='\0')
+    if(!prefix || !*prefix)
         return bstr_from_xmlChar(name);
 
-    dLen = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)prefix, -1, NULL, 0)
-        + MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)name, -1, NULL, 0);
-    bstr = SysAllocStringLen(NULL, dLen-1);
-    if(!bstr)
-        return NULL;
-
-    dLast = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)prefix, -1, bstr, dLen);
-    bstr[dLast-1] = ':';
-    MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)name, -1, &bstr[dLast], dLen-dLast);
+    qname = xmlBuildQName(name, prefix, NULL, 0);
+    bstr = bstr_from_xmlChar(qname);
+    xmlFree(qname);
 
     return bstr;
 }




More information about the wine-cvs mailing list