msxml3: Remove no longer used get_xml() option to mess with encoding attribute

Nikolay Sivov nsivov at codeweavers.com
Tue May 15 04:18:22 CDT 2012


Remove no longer used get_xml() option to mess with encoding attribute
-------------- next part --------------
>From de2c53bf9aacd50a2c1b5b6f7362006f5384e2b3 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue, 15 May 2012 11:49:58 +0400
Subject: [PATCH 1/1] 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 58be87d..0fa00ec 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 b07cd84..1cf3d29 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 3dab11b..172a1e6 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 cedd258..46b81b0 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 e760c84..26bfd0c 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 313fc2e..f2d46ab 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 026b5dc..18ddac8 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 adc38cb..36602eb 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 4d1910b..4d1cab7 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 705afd0..865c1d4 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(
-- 
1.5.6.5



More information about the wine-patches mailing list