[PATCH 3/4] Build qualified name using libxml2 helper
Nikolay Sivov
nsivov at codeweavers.com
Thu Oct 28 16:14:08 CDT 2010
---
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;
}
--
1.5.6.5
--------------030901060207040600020806--
More information about the wine-patches
mailing list