msxml3: Fix xml declaration output when it's specified in loaded document (in case of file).

This commit is contained in:
Nikolay Sivov 2012-07-08 22:51:52 +04:00 committed by Alexandre Julliard
parent 46d08bb6ce
commit 41aa34758e
1 changed files with 3 additions and 1 deletions

View File

@ -2403,6 +2403,8 @@ static HRESULT WINAPI domdoc_save(
case VT_BSTR:
case VT_BSTR | VT_BYREF:
{
int options = get_doc(This)->standalone == -1 ? XML_SAVE_NO_DECL : 0;
/* save with file path */
HANDLE handle = CreateFileW( (V_VT(&destination) & VT_BYREF)? *V_BSTRREF(&destination) : V_BSTR(&destination),
GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
@ -2414,7 +2416,7 @@ static HRESULT WINAPI domdoc_save(
/* disable top XML declaration */
ctx = xmlSaveToIO(domdoc_save_writecallback, domdoc_save_closecallback,
handle, NULL, XML_SAVE_NO_DECL);
handle, NULL, options);
if (!ctx)
{
CloseHandle(handle);