[XMLLITE] Sync with Wine Staging 1.7.47. CORE-9924

svn path=/trunk/; revision=68547
This commit is contained in:
Amine Khaldi 2015-07-22 00:49:19 +00:00
parent 88ef075b78
commit f740d443f7
3 changed files with 54 additions and 6 deletions

View file

@ -890,8 +890,20 @@ static inline WCHAR *reader_get_ptr(xmlreader *reader)
static int reader_cmp(xmlreader *reader, const WCHAR *str)
{
int i=0;
const WCHAR *ptr = reader_get_ptr(reader);
return strncmpW(str, ptr, strlenW(str));
while (str[i])
{
if (!ptr[i])
{
reader_more(reader);
ptr = reader_get_ptr(reader);
}
if (str[i] != ptr[i])
return ptr[i] - str[i];
i++;
}
return 0;
}
/* moves cursor n WCHARs forward */

View file

@ -49,7 +49,8 @@ typedef enum
XmlWriterState_PIDocStarted, /* document was started with manually added 'xml' PI */
XmlWriterState_DocStarted, /* document was started with WriteStartDocument() */
XmlWriterState_ElemStarted, /* writing element */
XmlWriterState_Content /* content is accepted at this point */
XmlWriterState_Content, /* content is accepted at this point */
XmlWriterState_DocClosed /* WriteEndDocument was called */
} XmlWriterState;
typedef struct
@ -598,6 +599,8 @@ static HRESULT WINAPI xmlwriter_WriteElementString(IXmlWriter *iface, LPCWSTR pr
case XmlWriterState_ElemStarted:
writer_close_starttag(This);
break;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
@ -621,10 +624,34 @@ static HRESULT WINAPI xmlwriter_WriteElementString(IXmlWriter *iface, LPCWSTR pr
static HRESULT WINAPI xmlwriter_WriteEndDocument(IXmlWriter *iface)
{
xmlwriter *This = impl_from_IXmlWriter(iface);
HRESULT hr = S_OK;
FIXME("%p\n", This);
TRACE("%p\n", This);
return E_NOTIMPL;
switch (This->state)
{
case XmlWriterState_Initial:
hr = E_UNEXPECTED;
break;
case XmlWriterState_Ready:
case XmlWriterState_DocClosed:
hr = WR_E_INVALIDACTION;
break;
default:
;
}
if (FAILED(hr)) {
This->state = XmlWriterState_DocClosed;
return hr;
}
/* empty element stack */
while (IXmlWriter_WriteEndElement(iface) == S_OK)
;
This->state = XmlWriterState_DocClosed;
return S_OK;
}
static HRESULT WINAPI xmlwriter_WriteEndElement(IXmlWriter *iface)
@ -739,6 +766,7 @@ static HRESULT WINAPI xmlwriter_WriteProcessingInstruction(IXmlWriter *iface, LP
return WR_E_INVALIDACTION;
break;
case XmlWriterState_ElemStarted:
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
@ -802,6 +830,7 @@ static HRESULT WINAPI xmlwriter_WriteStartDocument(IXmlWriter *iface, XmlStandal
return S_OK;
case XmlWriterState_DocStarted:
case XmlWriterState_ElemStarted:
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
@ -843,8 +872,15 @@ static HRESULT WINAPI xmlwriter_WriteStartElement(IXmlWriter *iface, LPCWSTR pre
TRACE("(%p)->(%s %s %s)\n", This, wine_dbgstr_w(prefix), wine_dbgstr_w(local_name), wine_dbgstr_w(uri));
if (This->state == XmlWriterState_Initial)
switch (This->state)
{
case XmlWriterState_Initial:
return E_UNEXPECTED;
case XmlWriterState_DocClosed:
return WR_E_INVALIDACTION;
default:
;
}
if (!local_name)
return E_INVALIDARG;

View file

@ -223,7 +223,7 @@ reactos/dll/win32/xinput1_1 # Synced to WineStaging-1.7.37
reactos/dll/win32/xinput1_2 # Synced to WineStaging-1.7.37
reactos/dll/win32/xinput1_3 # Synced to WineStaging-1.7.37
reactos/dll/win32/xinput9_1_0 # Synced to WineStaging-1.7.37
reactos/dll/win32/xmllite # Synced to WineStaging-1.7.37
reactos/dll/win32/xmllite # Synced to WineStaging-1.7.47
reactos/dll/cpl/inetcpl # Synced to WineStaging-1.7.47