From 945dccb7d60afd636bca380e80e14f7aa3f107c1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 4 Nov 2011 23:26:53 +0300 Subject: [PATCH] msxml3: Implement get_line() and get_linepos(). --- dlls/msxml3/parseerror.c | 23 +++++++++++++++-------- dlls/msxml3/tests/domdoc.c | 26 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/dlls/msxml3/parseerror.c b/dlls/msxml3/parseerror.c index b8cc381e3b2..c4610955e87 100644 --- a/dlls/msxml3/parseerror.c +++ b/dlls/msxml3/parseerror.c @@ -135,13 +135,10 @@ static HRESULT WINAPI parseError_GetTypeInfo( ITypeInfo** ppTInfo ) { parse_error_t *This = impl_from_IXMLDOMParseError( iface ); - HRESULT hr; TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); - hr = get_typeinfo(IXMLDOMParseError_tid, ppTInfo); - - return hr; + return get_typeinfo(IXMLDOMParseError_tid, ppTInfo); } static HRESULT WINAPI parseError_GetIDsOfNames( @@ -255,8 +252,13 @@ static HRESULT WINAPI parseError_get_line( LONG *line ) { parse_error_t *This = impl_from_IXMLDOMParseError( iface ); - FIXME("(%p)->(%p)\n", This, line); - return E_NOTIMPL; + + TRACE("(%p)->(%p): stub\n", This, line); + + if (!line) return E_INVALIDARG; + + *line = This->line; + return S_OK; } static HRESULT WINAPI parseError_get_linepos( @@ -264,8 +266,13 @@ static HRESULT WINAPI parseError_get_linepos( LONG *linepos ) { parse_error_t *This = impl_from_IXMLDOMParseError( iface ); - FIXME("(%p)->(%p)\n", This, linepos); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, linepos); + + if (!linepos) return E_INVALIDARG; + + *linepos = This->linepos; + return S_OK; } static HRESULT WINAPI parseError_get_filepos( diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index a883da0ad77..eeff419e4f9 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -10752,6 +10752,31 @@ static void test_dispex(void) free_bstrs(); } +static void test_parseerror(void) +{ + IXMLDOMParseError *error; + IXMLDOMDocument *doc; + HRESULT hr; + + doc = create_document(&IID_IXMLDOMDocument); + + hr = IXMLDOMDocument_get_parseError(doc, &error); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMParseError_get_line(error, NULL); + EXPECT_HR(hr, E_INVALIDARG); + + hr = IXMLDOMParseError_get_srcText(error, NULL); + todo_wine EXPECT_HR(hr, E_INVALIDARG); + + hr = IXMLDOMParseError_get_linepos(error, NULL); + EXPECT_HR(hr, E_INVALIDARG); + + IXMLDOMParseError_Release(error); + + IXMLDOMDocument_Release(doc); +} + START_TEST(domdoc) { IXMLDOMDocument *doc; @@ -10824,6 +10849,7 @@ START_TEST(domdoc) test_selection(); test_load(); test_dispex(); + test_parseerror(); test_xsltemplate();