msxml3: Corrected IXMLDOMComment appendData with a broken xmlTextConcat function.

This commit is contained in:
Alistair Leslie-Hughes 2008-04-20 00:09:58 +10:00 committed by Alexandre Julliard
parent 38634f0eb9
commit c3e9780d22
1 changed files with 23 additions and 1 deletions

View File

@ -597,10 +597,32 @@ static HRESULT WINAPI domcomment_appendData(
pContent = xmlChar_from_wchar( (WCHAR*)p );
if(pContent)
{
/* 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
hr = E_FAIL;
{
xmlChar *pNew;
pContent = xmlChar_from_wchar( (WCHAR*)p );
if(pContent)
{
pNew = xmlStrcat(xmlNodeGetContent(pDOMNode->node), pContent);
if(pNew)
{
xmlNodeSetContent(pDOMNode->node, pNew);
hr = S_OK;
}
else
hr = E_FAIL;
}
else
hr = E_FAIL;
}
}
else
hr = E_FAIL;