Module: wine Branch: master Commit: fedc26ec3f0fc292189cf60a58ff7cd393cef16f URL: http://source.winehq.org/git/wine.git/?a=commit;h=fedc26ec3f0fc292189cf60a58...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Jan 25 18:13:00 2017 +0100
mshtml: Added IHTMLSelectionObject2::get_typeDetail semi-stub implementation.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 2cf0e0a..dfbb386 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 e784189..7524d55 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)