From fedc26ec3f0fc292189cf60a58ff7cd393cef16f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 25 Jan 2017 18:13:00 +0100 Subject: [PATCH] mshtml: Added IHTMLSelectionObject2::get_typeDetail semi-stub implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/selection.c | 10 ++++++++-- dlls/mshtml/tests/dom.c | 11 +++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index 2cf0e0a59a2..dfbb386b938 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -307,8 +307,14 @@ static HRESULT WINAPI HTMLSelectionObject2_createRangeCollection(IHTMLSelectionO static HRESULT WINAPI HTMLSelectionObject2_get_typeDetail(IHTMLSelectionObject2 *iface, BSTR *p) { HTMLSelectionObject *This = impl_from_IHTMLSelectionObject2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + static const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; + + FIXME("(%p)->(%p) semi-stub\n", This, p); + + /* FIXME: We should try to use ISelectionServicesListener::GetTypeDetail here. */ + *p = SysAllocString(undefinedW); + return *p ? S_OK : E_OUTOFMEMORY; } static const IHTMLSelectionObject2Vtbl HTMLSelectionObject2Vtbl = { diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index e784189e130..7524d552a56 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -5381,6 +5381,7 @@ static void test_create_img_elem(IHTMLDocument2 *doc) #define test_doc_selection_type(a,b) _test_doc_selection_type(__LINE__,a,b) static void _test_doc_selection_type(unsigned line, IHTMLDocument2 *doc, const char *type) { + IHTMLSelectionObject2 *selection2; IHTMLSelectionObject *selection; BSTR str; HRESULT hres; @@ -5393,7 +5394,17 @@ static void _test_doc_selection_type(unsigned line, IHTMLDocument2 *doc, const c ok_(__FILE__,line)(!strcmp_wa(str, type), "type = %s, expected %s\n", wine_dbgstr_w(str), type); SysFreeString(str); + hres = IHTMLSelectionObject_QueryInterface(selection, &IID_IHTMLSelectionObject2, (void**)&selection2); + ok_(__FILE__,line)(hres == S_OK, "Could not get IHTMLSelectionObject2 iface: %08x\n", hres); + IHTMLSelectionObject_Release(selection); + + hres = IHTMLSelectionObject2_get_typeDetail(selection2, &str); + ok_(__FILE__,line)(hres == S_OK, "get_typeDetail failed: %08x\n", hres); + ok_(__FILE__,line)(!strcmp_wa(str, "undefined"), "typeDetail = %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + IHTMLSelectionObject2_Release(selection2); } #define insert_adjacent_elem(a,b,c) _insert_adjacent_elem(__LINE__,a,b,c)