shdocvw: Added SetExtent and GetExtent implementation.
This commit is contained in:
parent
13557abb7f
commit
3d1627f673
|
@ -395,15 +395,23 @@ static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfTyp
|
|||
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
|
||||
{
|
||||
WebBrowser *This = OLEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%lx %p)\n", This, dwDrawAspect, psizel);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%lx %p)\n", This, dwDrawAspect, psizel);
|
||||
|
||||
/* Tests show that dwDrawAspect is ignored */
|
||||
memcpy(&This->extent, psizel, sizeof(SIZEL));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
|
||||
{
|
||||
WebBrowser *This = OLEOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%lx, %p)\n", This, dwDrawAspect, psizel);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%lx, %p)\n", This, dwDrawAspect, psizel);
|
||||
|
||||
/* Tests show that dwDrawAspect is ignored */
|
||||
memcpy(psizel, &This->extent, sizeof(SIZEL));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink,
|
||||
|
@ -808,6 +816,9 @@ void WebBrowser_OleObject_Init(WebBrowser *This)
|
|||
memset(&This->pos_rect, 0, sizeof(RECT));
|
||||
memset(&This->clip_rect, 0, sizeof(RECT));
|
||||
memset(&This->frameinfo, 0, sizeof(OLEINPLACEFRAMEINFO));
|
||||
|
||||
This->extent.cx = 1323;
|
||||
This->extent.cy = 529;
|
||||
}
|
||||
|
||||
void WebBrowser_OleObject_Destroy(WebBrowser *This)
|
||||
|
|
|
@ -119,6 +119,7 @@ typedef struct {
|
|||
RECT pos_rect;
|
||||
RECT clip_rect;
|
||||
OLEINPLACEFRAMEINFO frameinfo;
|
||||
SIZEL extent;
|
||||
|
||||
HWND shell_embedding_hwnd;
|
||||
|
||||
|
|
|
@ -828,6 +828,70 @@ static void test_GetControlInfo(IUnknown *unk)
|
|||
IOleControl_Release(control);
|
||||
}
|
||||
|
||||
static void test_Extent(IUnknown *unk)
|
||||
{
|
||||
IOleObject *oleobj;
|
||||
SIZE size;
|
||||
HRESULT hres;
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
|
||||
ok(hres == S_OK, "Could not get IOleObkect: %08lx\n", hres);
|
||||
if(FAILED(hres))
|
||||
return;
|
||||
|
||||
size.cx = size.cy = 0xdeadbeef;
|
||||
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size);
|
||||
ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
|
||||
ok(size.cx == 1323 && size.cy == 529, "size = {%ld %ld}\n", size.cx, size.cy);
|
||||
|
||||
size.cx = 800;
|
||||
size.cy = 700;
|
||||
hres = IOleObject_SetExtent(oleobj, DVASPECT_CONTENT, &size);
|
||||
ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
|
||||
|
||||
size.cx = size.cy = 0xdeadbeef;
|
||||
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size);
|
||||
ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
|
||||
ok(size.cx == 800 && size.cy == 700, "size = {%ld %ld}\n", size.cx, size.cy);
|
||||
|
||||
size.cx = size.cy = 0xdeadbeef;
|
||||
hres = IOleObject_GetExtent(oleobj, 0, &size);
|
||||
ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
|
||||
ok(size.cx == 800 && size.cy == 700, "size = {%ld %ld}\n", size.cx, size.cy);
|
||||
|
||||
size.cx = 900;
|
||||
size.cy = 800;
|
||||
hres = IOleObject_SetExtent(oleobj, 0, &size);
|
||||
ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
|
||||
|
||||
size.cx = size.cy = 0xdeadbeef;
|
||||
hres = IOleObject_GetExtent(oleobj, 0, &size);
|
||||
ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
|
||||
ok(size.cx == 900 && size.cy == 800, "size = {%ld %ld}\n", size.cx, size.cy);
|
||||
|
||||
size.cx = size.cy = 0xdeadbeef;
|
||||
hres = IOleObject_GetExtent(oleobj, 0xdeadbeef, &size);
|
||||
ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
|
||||
ok(size.cx == 900 && size.cy == 800, "size = {%ld %ld}\n", size.cx, size.cy);
|
||||
|
||||
size.cx = 1000;
|
||||
size.cy = 900;
|
||||
hres = IOleObject_SetExtent(oleobj, 0xdeadbeef, &size);
|
||||
ok(hres == S_OK, "SetExtent failed: %08lx\n", hres);
|
||||
|
||||
size.cx = size.cy = 0xdeadbeef;
|
||||
hres = IOleObject_GetExtent(oleobj, 0xdeadbeef, &size);
|
||||
ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
|
||||
ok(size.cx == 1000 && size.cy == 900, "size = {%ld %ld}\n", size.cx, size.cy);
|
||||
|
||||
size.cx = size.cy = 0xdeadbeef;
|
||||
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size);
|
||||
ok(hres == S_OK, "GetExtent failed: %08lx\n", hres);
|
||||
ok(size.cx == 1000 && size.cy == 900, "size = {%ld %ld}\n", size.cx, size.cy);
|
||||
|
||||
IOleObject_Release(oleobj);
|
||||
}
|
||||
|
||||
static void test_WebBrowser(void)
|
||||
{
|
||||
IUnknown *unk = NULL;
|
||||
|
@ -842,6 +906,7 @@ static void test_WebBrowser(void)
|
|||
|
||||
test_ClassInfo(unk);
|
||||
test_ClientSite(unk, &ClientSite);
|
||||
test_Extent(unk);
|
||||
test_DoVerb(unk);
|
||||
test_ClientSite(unk, NULL);
|
||||
test_ie_funcs(unk);
|
||||
|
|
Loading…
Reference in New Issue