[05/13] msxml3: Remove superflous re-conversion from wide chars to utf8

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Sat Oct 11 16:58:27 CDT 2008


The comment telling that older libxml variants would destroy the
characters pointed to by pContent is wrong for sure, as all
versions of libxml2 take this parameter via "const xmlChar*"
(verified in GNOME's WebSVN), and also fail at the very beginning
for comment nodes (until the test got fixed).

So, this patch removes the comment and the second conversion using
xmlChar_from_wchar.
---
 dlls/msxml3/comment.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c
index 1870b3b..ec6355f 100644
--- a/dlls/msxml3/comment.c
+++ b/dlls/msxml3/comment.c
@@ -601,25 +601,17 @@ static HRESULT WINAPI domcomment_appendData(
         /* Older versions of libxml < 2.6.27 didn't correctly support
            xmlTextConcat on Comment nodes. Fallback to setting the
            contents directly if xmlTextConcat fails.
-
-           NOTE: if xmlTextConcat fails, pContent is destroyed.
          */
         if(xmlTextConcat(pDOMNode->node, pContent, SysStringLen(p) ) == 0)
             hr = S_OK;
         else
         {
             xmlChar *pNew;
-            pContent = xmlChar_from_wchar( (WCHAR*)p );
-            if(pContent)
+            pNew = xmlStrcat(xmlNodeGetContent(pDOMNode->node), pContent);
+            if(pNew)
             {
-                pNew = xmlStrcat(xmlNodeGetContent(pDOMNode->node), pContent);
-                if(pNew)
-                {
-                    xmlNodeSetContent(pDOMNode->node, pNew);
-                    hr = S_OK;
-                }
-                else
-                    hr = E_FAIL;
+                xmlNodeSetContent(pDOMNode->node, pNew);
+                hr = S_OK;
             }
             else
                 hr = E_FAIL;
-- 
1.5.6.5




More information about the wine-patches mailing list