From edf6162340847742c93af2efffc11274a7d503a6 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 15 May 2012 11:49:58 +0400 Subject: [PATCH] msxml3: Remove no longer used get_xml() option to mess with encoding attribute. --- dlls/msxml3/attribute.c | 2 +- dlls/msxml3/cdata.c | 2 +- dlls/msxml3/comment.c | 2 +- dlls/msxml3/docfrag.c | 2 +- dlls/msxml3/element.c | 2 +- dlls/msxml3/entityref.c | 2 +- dlls/msxml3/msxml_private.h | 2 +- dlls/msxml3/node.c | 37 ++----------------------------------- dlls/msxml3/pi.c | 2 +- dlls/msxml3/text.c | 2 +- 10 files changed, 11 insertions(+), 44 deletions(-) diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 58be87d8c16..0fa00ec5d16 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -497,7 +497,7 @@ static HRESULT WINAPI domattr_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI domattr_transformNode( diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index b07cd84bec4..1cf3d29b397 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -452,7 +452,7 @@ static HRESULT WINAPI domcdata_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI domcdata_transformNode( diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index 3dab11bb139..172a1e68235 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -451,7 +451,7 @@ static HRESULT WINAPI domcomment_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI domcomment_transformNode( diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c index cedd258a37a..46b81b08082 100644 --- a/dlls/msxml3/docfrag.c +++ b/dlls/msxml3/docfrag.c @@ -449,7 +449,7 @@ static HRESULT WINAPI domfrag_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI domfrag_transformNode( diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index e760c8493e1..26bfd0cbe18 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -926,7 +926,7 @@ static HRESULT WINAPI domelem_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, TRUE, FALSE, p); + return node_get_xml(&This->node, TRUE, p); } static HRESULT WINAPI domelem_transformNode( diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c index 313fc2ec63a..f2d46ababae 100644 --- a/dlls/msxml3/entityref.c +++ b/dlls/msxml3/entityref.c @@ -444,7 +444,7 @@ static HRESULT WINAPI entityref_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI entityref_transformNode( diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 026b5dc45a2..18ddac89a60 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -329,7 +329,7 @@ extern HRESULT node_get_next_sibling(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN; extern HRESULT node_insert_before(xmlnode*,IXMLDOMNode*,const VARIANT*,IXMLDOMNode**) DECLSPEC_HIDDEN; extern HRESULT node_replace_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode*,IXMLDOMNode**) DECLSPEC_HIDDEN; extern HRESULT node_put_text(xmlnode*,BSTR) DECLSPEC_HIDDEN; -extern HRESULT node_get_xml(xmlnode*,BOOL,BOOL,BSTR*) DECLSPEC_HIDDEN; +extern HRESULT node_get_xml(xmlnode*,BOOL,BSTR*) DECLSPEC_HIDDEN; extern HRESULT node_clone(xmlnode*,VARIANT_BOOL,IXMLDOMNode**) DECLSPEC_HIDDEN; extern HRESULT node_get_prefix(xmlnode*,BSTR*) DECLSPEC_HIDDEN; extern HRESULT node_get_base_name(xmlnode*,BSTR*) DECLSPEC_HIDDEN; diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index adc38cbd6d5..36602eb2f40 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -787,37 +787,6 @@ BSTR EnsureCorrectEOL(BSTR sInput) return sNew; } -/* Removes encoding information and last character (nullbyte) */ -static BSTR EnsureNoEncoding(BSTR sInput) -{ - static const WCHAR wszEncoding[] = {'e','n','c','o','d','i','n','g','='}; - BSTR sNew; - WCHAR *pBeg, *pEnd; - - pBeg = sInput; - while(*pBeg != '\n' && memcmp(pBeg, wszEncoding, sizeof(wszEncoding))) - pBeg++; - - if(*pBeg == '\n') - { - SysReAllocStringLen(&sInput, sInput, SysStringLen(sInput)-1); - return sInput; - } - pBeg--; - - pEnd = pBeg + sizeof(wszEncoding)/sizeof(WCHAR) + 2; - while(*pEnd != '\"') pEnd++; - pEnd++; - - sNew = SysAllocStringLen(NULL, - pBeg-sInput + SysStringLen(sInput)-(pEnd-sInput)-1); - memcpy(sNew, sInput, (pBeg-sInput)*sizeof(WCHAR)); - memcpy(&sNew[pBeg-sInput], pEnd, (SysStringLen(sInput)-(pEnd-sInput)-1)*sizeof(WCHAR)); - - SysFreeString(sInput); - return sNew; -} - /* * We are trying to replicate the same behaviour as msxml by converting * line endings to \r\n and using indents as \t. The problem is that msxml @@ -825,7 +794,7 @@ static BSTR EnsureNoEncoding(BSTR sInput) * reproduce behaviour exactly. * */ -HRESULT node_get_xml(xmlnode *This, BOOL ensure_eol, BOOL ensure_no_encoding, BSTR *ret) +HRESULT node_get_xml(xmlnode *This, BOOL ensure_eol, BSTR *ret) { xmlBufferPtr xml_buf; xmlNodePtr xmldecl; @@ -853,8 +822,6 @@ HRESULT node_get_xml(xmlnode *This, BOOL ensure_eol, BOOL ensure_no_encoding, BS content = bstr_from_xmlChar(buf_content + (buf_content[0] == ' ' ? 1 : 0)); if(ensure_eol) content = EnsureCorrectEOL(content); - if(ensure_no_encoding) - content = EnsureNoEncoding(content); *ret = content; }else { @@ -1453,7 +1420,7 @@ static HRESULT WINAPI unknode_get_xml( FIXME("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI unknode_transformNode( diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index 4d1910b64a3..4d1cab7948f 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -487,7 +487,7 @@ static HRESULT WINAPI dom_pi_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI dom_pi_transformNode( diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index 705afd060c7..865c1d4f3d0 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -514,7 +514,7 @@ static HRESULT WINAPI domtext_get_xml( TRACE("(%p)->(%p)\n", This, p); - return node_get_xml(&This->node, FALSE, FALSE, p); + return node_get_xml(&This->node, FALSE, p); } static HRESULT WINAPI domtext_transformNode( -- 2.11.4.GIT