Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6167c612
Commit
6167c612
authored
Mar 12, 2008
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Mar 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Allow IXMLDOMDocument to save as another IXMLDOMDocument.
parent
a1cce928
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
2 deletions
+82
-2
domdoc.c
dlls/msxml3/domdoc.c
+27
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+55
-0
No files found.
dlls/msxml3/domdoc.c
View file @
6167c612
...
...
@@ -1559,12 +1559,37 @@ static HRESULT WINAPI domdoc_save(
TRACE
(
"(%p)->(var(vt %x, %s))
\n
"
,
This
,
V_VT
(
&
destination
),
V_VT
(
&
destination
)
==
VT_BSTR
?
debugstr_w
(
V_BSTR
(
&
destination
))
:
NULL
);
if
(
V_VT
(
&
destination
)
!=
VT_BSTR
)
if
(
V_VT
(
&
destination
)
!=
VT_BSTR
&&
V_VT
(
&
destination
)
!=
VT_UNKNOWN
)
{
FIXME
(
"Unhandled vt %
x
\n
"
,
V_VT
(
&
destination
));
FIXME
(
"Unhandled vt %
d
\n
"
,
V_VT
(
&
destination
));
return
S_FALSE
;
}
if
(
V_VT
(
&
destination
)
==
VT_UNKNOWN
)
{
IUnknown
*
pUnk
=
V_UNKNOWN
(
&
destination
);
IXMLDOMDocument
*
pDocument
;
ret
=
IXMLDOMDocument_QueryInterface
(
pUnk
,
&
IID_IXMLDOMDocument2
,
(
void
**
)
&
pDocument
);
if
(
ret
==
S_OK
)
{
BSTR
bXML
;
VARIANT_BOOL
bSuccessful
;
ret
=
IXMLDOMDocument_get_xml
(
iface
,
&
bXML
);
if
(
ret
==
S_OK
)
{
ret
=
IXMLDOMDocument_loadXML
(
pDocument
,
bXML
,
&
bSuccessful
);
SysFreeString
(
bXML
);
}
IXMLDOMDocument_Release
(
pDocument
);
}
return
ret
;
}
handle
=
CreateFileW
(
V_BSTR
(
&
destination
),
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
...
...
dlls/msxml3/tests/domdoc.c
View file @
6167c612
...
...
@@ -3013,6 +3013,60 @@ static void test_nodeTypeTests( void )
free_bstrs
();
}
static
void
test_DocumentSaveToDocument
(
void
)
{
IXMLDOMDocument
*
doc
=
NULL
;
IXMLDOMDocument
*
doc2
=
NULL
;
IXMLDOMElement
*
pRoot
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument2
,
(
LPVOID
*
)
&
doc
);
if
(
hr
!=
S_OK
)
return
;
hr
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument2
,
(
LPVOID
*
)
&
doc2
);
if
(
hr
!=
S_OK
)
{
IXMLDOMDocument_Release
(
doc
);
return
;
}
hr
=
IXMLDOMDocument_createElement
(
doc
,
_bstr_
(
"Testing"
),
&
pRoot
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IXMLDOMDocument_appendChild
(
doc
,
(
IXMLDOMNode
*
)
pRoot
,
NULL
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
VARIANT
vDoc
;
BSTR
sOrig
;
BSTR
sNew
;
V_VT
(
&
vDoc
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
vDoc
)
=
(
IUnknown
*
)
doc2
;
hr
=
IXMLDOMDocument_save
(
doc
,
vDoc
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_get_xml
(
doc
,
&
sOrig
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IXMLDOMDocument_get_xml
(
doc2
,
&
sNew
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
sOrig
,
sNew
),
"New document is not the same as origial
\n
"
);
SysFreeString
(
sOrig
);
SysFreeString
(
sNew
);
}
}
IXMLDOMDocument_Release
(
doc2
);
IXMLDOMDocument_Release
(
doc
);
}
START_TEST
(
domdoc
)
{
HRESULT
r
;
...
...
@@ -3034,6 +3088,7 @@ START_TEST(domdoc)
test_cloneNode
();
test_xmlTypes
();
test_nodeTypeTests
();
test_DocumentSaveToDocument
();
CoUninitialize
();
}
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