Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
11df66af
Commit
11df66af
authored
May 04, 2011
by
Adam Martinson
Committed by
Alexandre Julliard
May 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Don't add a <?xml...?> decl in domdoc_get_xml().
parent
62b5d12c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
domdoc.c
dlls/msxml3/domdoc.c
+2
-8
domdoc.c
dlls/msxml3/tests/domdoc.c
+22
-1
No files found.
dlls/msxml3/domdoc.c
View file @
11df66af
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* DOM Document implementation
* DOM Document implementation
*
*
* Copyright 2005 Mike McCormack
* Copyright 2005 Mike McCormack
* Copyright 2010 Adam Martinson for CodeWeavers
* Copyright 2010
-2011
Adam Martinson for CodeWeavers
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -370,11 +370,6 @@ static void free_properties(domdoc_properties* properties)
...
@@ -370,11 +370,6 @@ static void free_properties(domdoc_properties* properties)
}
}
}
}
static
BOOL
xmldoc_has_decl
(
xmlDocPtr
doc
)
{
return
doc
->
children
&&
(
xmlStrEqual
(
doc
->
children
->
name
,
(
xmlChar
*
)
"xml"
)
==
1
);
}
/* links a "<?xml" node as a first child */
/* links a "<?xml" node as a first child */
void
xmldoc_link_xmldecl
(
xmlDocPtr
doc
,
xmlNodePtr
node
)
void
xmldoc_link_xmldecl
(
xmlDocPtr
doc
,
xmlNodePtr
node
)
{
{
...
@@ -1394,8 +1389,7 @@ static HRESULT WINAPI domdoc_get_xml(
...
@@ -1394,8 +1389,7 @@ static HRESULT WINAPI domdoc_get_xml(
if
(
!
buf
)
if
(
!
buf
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
options
=
xmldoc_has_decl
(
get_doc
(
This
))
?
XML_SAVE_NO_DECL
:
0
;
options
=
XML_SAVE_FORMAT
|
XML_SAVE_NO_DECL
;
options
|=
XML_SAVE_FORMAT
;
ctxt
=
xmlSaveToIO
(
domdoc_get_xml_writecallback
,
NULL
,
buf
,
"UTF-8"
,
options
);
ctxt
=
xmlSaveToIO
(
domdoc_get_xml_writecallback
,
NULL
,
buf
,
"UTF-8"
,
options
);
if
(
!
ctxt
)
if
(
!
ctxt
)
...
...
dlls/msxml3/tests/domdoc.c
View file @
11df66af
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright 2005 Mike McCormack for CodeWeavers
* Copyright 2005 Mike McCormack for CodeWeavers
* Copyright 2007-2008 Alistair Leslie-Hughes
* Copyright 2007-2008 Alistair Leslie-Hughes
* Copyright 2010 Adam Martinson for CodeWeavers
* Copyright 2010
-2011
Adam Martinson for CodeWeavers
* Copyright 2010-2011 Nikolay Sivov for CodeWeavers
* Copyright 2010-2011 Nikolay Sivov for CodeWeavers
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
...
@@ -8972,8 +8972,10 @@ static void test_put_nodeTypedValue(void)
...
@@ -8972,8 +8972,10 @@ static void test_put_nodeTypedValue(void)
static
void
test_get_xml
(
void
)
static
void
test_get_xml
(
void
)
{
{
static
const
char
xmlA
[]
=
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-16
\"
?>
\r\n
<a>test</a>
\r\n
"
;
static
const
char
xmlA
[]
=
"<?xml version=
\"
1.0
\"
encoding=
\"
UTF-16
\"
?>
\r\n
<a>test</a>
\r\n
"
;
static
const
char
fooA
[]
=
"<foo/>"
;
IXMLDOMProcessingInstruction
*
pi
;
IXMLDOMProcessingInstruction
*
pi
;
IXMLDOMNode
*
first
;
IXMLDOMNode
*
first
;
IXMLDOMElement
*
elem
=
NULL
;
IXMLDOMDocument
*
doc
;
IXMLDOMDocument
*
doc
;
VARIANT_BOOL
b
;
VARIANT_BOOL
b
;
VARIANT
v
;
VARIANT
v
;
...
@@ -9012,6 +9014,25 @@ static void test_get_xml(void)
...
@@ -9012,6 +9014,25 @@ static void test_get_xml(void)
SysFreeString
(
xml
);
SysFreeString
(
xml
);
IXMLDOMDocument_Release
(
doc
);
IXMLDOMDocument_Release
(
doc
);
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
hr
=
IXMLDOMDocument_createElement
(
doc
,
_bstr_
(
"foo"
),
&
elem
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_putref_documentElement
(
doc
,
elem
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_get_xml
(
doc
,
&
xml
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
memcmp
(
xml
,
_bstr_
(
fooA
),
(
sizeof
(
fooA
)
-
1
)
*
sizeof
(
WCHAR
))
==
0
,
"got %s, expected %s
\n
"
,
wine_dbgstr_w
(
xml
),
fooA
);
SysFreeString
(
xml
);
IXMLDOMElement_Release
(
elem
);
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
free_bstrs
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment