msxml3: Added IVBSAXLexicalHandler interface for MXWriter.
This commit is contained in:
parent
94dcff1dda
commit
d6de1be777
|
@ -141,6 +141,7 @@ typedef struct
|
|||
ISAXLexicalHandler ISAXLexicalHandler_iface;
|
||||
ISAXDeclHandler ISAXDeclHandler_iface;
|
||||
IVBSAXDeclHandler IVBSAXDeclHandler_iface;
|
||||
IVBSAXLexicalHandler IVBSAXLexicalHandler_iface;
|
||||
|
||||
LONG ref;
|
||||
MSXML_VERSION class_version;
|
||||
|
@ -633,6 +634,11 @@ static inline mxwriter *impl_from_ISAXLexicalHandler(ISAXLexicalHandler *iface)
|
|||
return CONTAINING_RECORD(iface, mxwriter, ISAXLexicalHandler_iface);
|
||||
}
|
||||
|
||||
static inline mxwriter *impl_from_IVBSAXLexicalHandler(IVBSAXLexicalHandler *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, mxwriter, IVBSAXLexicalHandler_iface);
|
||||
}
|
||||
|
||||
static inline mxwriter *impl_from_ISAXDeclHandler(ISAXDeclHandler *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, mxwriter, ISAXDeclHandler_iface);
|
||||
|
@ -673,6 +679,10 @@ static HRESULT WINAPI mxwriter_QueryInterface(IMXWriter *iface, REFIID riid, voi
|
|||
{
|
||||
*obj = &This->IVBSAXDeclHandler_iface;
|
||||
}
|
||||
else if ( IsEqualGUID( riid, &IID_IVBSAXLexicalHandler ) )
|
||||
{
|
||||
*obj = &This->IVBSAXLexicalHandler_iface;
|
||||
}
|
||||
else if (dispex_query_interface(&This->dispex, riid, obj))
|
||||
{
|
||||
return *obj ? S_OK : E_NOINTERFACE;
|
||||
|
@ -1768,6 +1778,136 @@ static const IVBSAXDeclHandlerVtbl VBSAXDeclHandlerVtbl = {
|
|||
VBSAXDeclHandler_externalEntityDecl
|
||||
};
|
||||
|
||||
/*** IVBSAXLexicalHandler ***/
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_QueryInterface(IVBSAXLexicalHandler *iface,
|
||||
REFIID riid, void **obj)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
|
||||
}
|
||||
|
||||
static ULONG WINAPI VBSAXLexicalHandler_AddRef(IVBSAXLexicalHandler *iface)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return IMXWriter_AddRef(&This->IMXWriter_iface);
|
||||
}
|
||||
|
||||
static ULONG WINAPI VBSAXLexicalHandler_Release(IVBSAXLexicalHandler *iface)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return IMXWriter_Release(&This->IMXWriter_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfoCount(IVBSAXLexicalHandler *iface, UINT* pctinfo)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return IMXWriter_GetTypeInfoCount(&This->IMXWriter_iface, pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfo(IVBSAXLexicalHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo** ppTInfo)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return IMXWriter_GetTypeInfo(&This->IMXWriter_iface, iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_GetIDsOfNames(IVBSAXLexicalHandler *iface, REFIID riid, LPOLESTR* rgszNames,
|
||||
UINT cNames, LCID lcid, DISPID* rgDispId )
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return IMXWriter_GetIDsOfNames(&This->IMXWriter_iface, riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_Invoke(IVBSAXLexicalHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
|
||||
WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr )
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return IMXWriter_Invoke(&This->IMXWriter_iface, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult,
|
||||
pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_startDTD(IVBSAXLexicalHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
|
||||
TRACE("(%p)->(%p %p %p)\n", This, name, publicId, systemId);
|
||||
|
||||
if (!name || !publicId || !systemId)
|
||||
return E_POINTER;
|
||||
|
||||
return ISAXLexicalHandler_startDTD(&This->ISAXLexicalHandler_iface, *name, -1, *publicId, -1, *systemId, -1);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_endDTD(IVBSAXLexicalHandler *iface)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return ISAXLexicalHandler_endDTD(&This->ISAXLexicalHandler_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_startEntity(IVBSAXLexicalHandler *iface, BSTR *name)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, name);
|
||||
|
||||
if (!name)
|
||||
return E_POINTER;
|
||||
|
||||
return ISAXLexicalHandler_startEntity(&This->ISAXLexicalHandler_iface, *name, -1);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_endEntity(IVBSAXLexicalHandler *iface, BSTR *name)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, name);
|
||||
|
||||
if (!name)
|
||||
return E_POINTER;
|
||||
|
||||
return ISAXLexicalHandler_endEntity(&This->ISAXLexicalHandler_iface, *name, -1);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_startCDATA(IVBSAXLexicalHandler *iface)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return ISAXLexicalHandler_startCDATA(&This->ISAXLexicalHandler_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_endCDATA(IVBSAXLexicalHandler *iface)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
return ISAXLexicalHandler_endCDATA(&This->ISAXLexicalHandler_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI VBSAXLexicalHandler_comment(IVBSAXLexicalHandler *iface, BSTR *chars)
|
||||
{
|
||||
mxwriter *This = impl_from_IVBSAXLexicalHandler( iface );
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, chars);
|
||||
|
||||
if (!chars)
|
||||
return E_POINTER;
|
||||
|
||||
return ISAXLexicalHandler_comment(&This->ISAXLexicalHandler_iface, *chars, -1);
|
||||
}
|
||||
|
||||
static const IVBSAXLexicalHandlerVtbl VBSAXLexicalHandlerVtbl = {
|
||||
VBSAXLexicalHandler_QueryInterface,
|
||||
VBSAXLexicalHandler_AddRef,
|
||||
VBSAXLexicalHandler_Release,
|
||||
VBSAXLexicalHandler_GetTypeInfoCount,
|
||||
VBSAXLexicalHandler_GetTypeInfo,
|
||||
VBSAXLexicalHandler_GetIDsOfNames,
|
||||
VBSAXLexicalHandler_Invoke,
|
||||
VBSAXLexicalHandler_startDTD,
|
||||
VBSAXLexicalHandler_endDTD,
|
||||
VBSAXLexicalHandler_startEntity,
|
||||
VBSAXLexicalHandler_endEntity,
|
||||
VBSAXLexicalHandler_startCDATA,
|
||||
VBSAXLexicalHandler_endCDATA,
|
||||
VBSAXLexicalHandler_comment
|
||||
};
|
||||
|
||||
static const tid_t mxwriter_iface_tids[] = {
|
||||
IMXWriter_tid,
|
||||
0
|
||||
|
@ -1797,6 +1937,7 @@ HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj)
|
|||
This->ISAXLexicalHandler_iface.lpVtbl = &SAXLexicalHandlerVtbl;
|
||||
This->ISAXDeclHandler_iface.lpVtbl = &SAXDeclHandlerVtbl;
|
||||
This->IVBSAXDeclHandler_iface.lpVtbl = &VBSAXDeclHandlerVtbl;
|
||||
This->IVBSAXLexicalHandler_iface.lpVtbl = &VBSAXLexicalHandlerVtbl;
|
||||
This->ref = 1;
|
||||
This->class_version = version;
|
||||
|
||||
|
|
|
@ -4497,6 +4497,7 @@ static void test_mxwriter_dispex(void)
|
|||
static void test_mxwriter_comment(void)
|
||||
{
|
||||
static const WCHAR commentW[] = {'c','o','m','m','e','n','t',0};
|
||||
IVBSAXLexicalHandler *vblexical;
|
||||
ISAXContentHandler *content;
|
||||
ISAXLexicalHandler *lexical;
|
||||
IMXWriter *writer;
|
||||
|
@ -4513,6 +4514,9 @@ static void test_mxwriter_comment(void)
|
|||
hr = IMXWriter_QueryInterface(writer, &IID_ISAXLexicalHandler, (void**)&lexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXLexicalHandler, (void**)&vblexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
|
@ -4522,6 +4526,9 @@ static void test_mxwriter_comment(void)
|
|||
hr = ISAXLexicalHandler_comment(lexical, NULL, 0);
|
||||
EXPECT_HR(hr, E_INVALIDARG);
|
||||
|
||||
hr = IVBSAXLexicalHandler_comment(vblexical, NULL);
|
||||
EXPECT_HR(hr, E_POINTER);
|
||||
|
||||
hr = ISAXLexicalHandler_comment(lexical, commentW, 0);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
|
@ -4544,12 +4551,14 @@ static void test_mxwriter_comment(void)
|
|||
|
||||
ISAXContentHandler_Release(content);
|
||||
ISAXLexicalHandler_Release(lexical);
|
||||
IVBSAXLexicalHandler_Release(vblexical);
|
||||
IMXWriter_Release(writer);
|
||||
free_bstrs();
|
||||
}
|
||||
|
||||
static void test_mxwriter_cdata(void)
|
||||
{
|
||||
IVBSAXLexicalHandler *vblexical;
|
||||
ISAXContentHandler *content;
|
||||
ISAXLexicalHandler *lexical;
|
||||
IMXWriter *writer;
|
||||
|
@ -4566,6 +4575,9 @@ static void test_mxwriter_cdata(void)
|
|||
hr = IMXWriter_QueryInterface(writer, &IID_ISAXLexicalHandler, (void**)&lexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXLexicalHandler, (void**)&vblexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
|
@ -4582,7 +4594,7 @@ static void test_mxwriter_cdata(void)
|
|||
ok(!lstrcmpW(_bstr_("<![CDATA["), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest)));
|
||||
VariantClear(&dest);
|
||||
|
||||
hr = ISAXLexicalHandler_startCDATA(lexical);
|
||||
hr = IVBSAXLexicalHandler_startCDATA(vblexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
/* all these are escaped for text nodes */
|
||||
|
@ -4601,6 +4613,7 @@ static void test_mxwriter_cdata(void)
|
|||
|
||||
ISAXContentHandler_Release(content);
|
||||
ISAXLexicalHandler_Release(lexical);
|
||||
IVBSAXLexicalHandler_Release(vblexical);
|
||||
IMXWriter_Release(writer);
|
||||
free_bstrs();
|
||||
}
|
||||
|
@ -4710,6 +4723,7 @@ static void test_mxwriter_dtd(void)
|
|||
static const WCHAR nameW[] = {'n','a','m','e'};
|
||||
static const WCHAR pubW[] = {'p','u','b'};
|
||||
static const WCHAR sysW[] = {'s','y','s'};
|
||||
IVBSAXLexicalHandler *vblexical;
|
||||
ISAXContentHandler *content;
|
||||
ISAXLexicalHandler *lexical;
|
||||
IVBSAXDeclHandler *vbdecl;
|
||||
|
@ -4734,6 +4748,9 @@ static void test_mxwriter_dtd(void)
|
|||
hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXDeclHandler, (void**)&vbdecl);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
hr = IMXWriter_QueryInterface(writer, &IID_IVBSAXLexicalHandler, (void**)&vblexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
|
@ -4743,6 +4760,9 @@ static void test_mxwriter_dtd(void)
|
|||
hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, NULL, 0, NULL, 0);
|
||||
EXPECT_HR(hr, E_INVALIDARG);
|
||||
|
||||
hr = IVBSAXLexicalHandler_startDTD(vblexical, NULL, NULL, NULL);
|
||||
EXPECT_HR(hr, E_POINTER);
|
||||
|
||||
hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, pubW, sizeof(pubW)/sizeof(WCHAR), NULL, 0);
|
||||
EXPECT_HR(hr, E_INVALIDARG);
|
||||
|
||||
|
@ -4781,7 +4801,7 @@ static void test_mxwriter_dtd(void)
|
|||
hr = ISAXLexicalHandler_endDTD(lexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
hr = ISAXLexicalHandler_endDTD(lexical);
|
||||
hr = IVBSAXLexicalHandler_endDTD(vblexical);
|
||||
EXPECT_HR(hr, S_OK);
|
||||
|
||||
V_VT(&dest) = VT_EMPTY;
|
||||
|
@ -4922,6 +4942,7 @@ static void test_mxwriter_dtd(void)
|
|||
|
||||
ISAXContentHandler_Release(content);
|
||||
ISAXLexicalHandler_Release(lexical);
|
||||
IVBSAXLexicalHandler_Release(vblexical);
|
||||
IVBSAXDeclHandler_Release(vbdecl);
|
||||
ISAXDeclHandler_Release(decl);
|
||||
IMXWriter_Release(writer);
|
||||
|
|
Loading…
Reference in New Issue