[PATCH v2 2/2] msxml3: Don't unlink the XML declaration when saving document.
Dmitry Timoshkov
dmitry at baikal.ru
Thu Apr 1 06:20:58 CDT 2021
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
dlls/msxml3/domdoc.c | 3 ---
dlls/msxml3/tests/domdoc.c | 4 ++--
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 80c32e9ba99..a81ef5f16cb 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -2534,7 +2534,6 @@ static HRESULT WINAPI domdoc_save(
{
domdoc *This = impl_from_IXMLDOMDocument3( iface );
xmlSaveCtxtPtr ctx = NULL;
- xmlNodePtr xmldecl;
HRESULT ret = S_OK;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&destination));
@@ -2610,9 +2609,7 @@ static HRESULT WINAPI domdoc_save(
return S_FALSE;
}
- xmldecl = xmldoc_unlink_xmldecl(get_doc(This));
if (xmlSaveDoc(ctx, get_doc(This)) == -1) ret = S_FALSE;
- xmldoc_link_xmldecl(get_doc(This), xmldecl);
/* will release resources through close callback */
xmlSaveClose(ctx);
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 5bc2fe1d5c3..72968fff11b 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -8524,6 +8524,7 @@ static void test_createProcessingInstruction(void)
{
static const WCHAR xml1[] = L"<?xml version=\"1.0\"?>\r\n<test/>\r\n";
static const char xml2[] = "<?xml version=\"1.0\" encoding=\"windows-1252\"?>\r\n<test/>\r\n";
+ static const char xml2_wine[] = "<?xml version=\"1.0\" encoding=\"windows-1252\"?>\n<test/>\n";
IXMLDOMProcessingInstruction *pi;
IXMLDOMDocument *doc;
IXMLDOMNode *node;
@@ -8582,8 +8583,7 @@ todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
p = GlobalLock(global);
p[GlobalSize(global)] = 0;
-todo_wine
- ok(!strcmp(p, xml2), "got %s\n", wine_dbgstr_a(p));
+ ok(!strcmp(p, xml2) || !strcmp(p, xml2_wine), "got %s\n", wine_dbgstr_a(p));
GlobalUnlock(global);
IStream_Release(stream);
--
2.30.2
More information about the wine-devel
mailing list