shdocvw: Fix the computation of the default extents.

This commit is contained in:
Alexandre Julliard 2008-11-21 17:07:21 +01:00
parent bd8e14bedd
commit e37f8f23f1
2 changed files with 9 additions and 8 deletions

View File

@ -917,9 +917,9 @@ void WebBrowser_OleObject_Init(WebBrowser *This)
memset(&This->clip_rect, 0, sizeof(RECT));
memset(&This->frameinfo, 0, sizeof(OLEINPLACEFRAMEINFO));
/* The size is dpi dependent */
This->extent.cx = 127000 / dpi_x;
This->extent.cy = 50800 / dpi_y;
/* Default size is 50x20 pixels, in himetric units */
This->extent.cx = MulDiv( 50, 2540, dpi_x );
This->extent.cy = MulDiv( 20, 2540, dpi_y );
}
void WebBrowser_OleObject_Destroy(WebBrowser *This)

View File

@ -1814,7 +1814,7 @@ static void test_GetControlInfo(IUnknown *unk)
static void test_Extent(IUnknown *unk)
{
IOleObject *oleobj;
SIZE size;
SIZE size, expected;
HRESULT hres;
DWORD dpi_x;
DWORD dpi_y;
@ -1836,10 +1836,11 @@ static void test_Extent(IUnknown *unk)
size.cx = size.cy = 0xdeadbeef;
hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size);
ok(hres == S_OK, "GetExtent failed: %08x\n", hres);
/* The default size is dpi dependent (96:1323x529 / 120:1058x423) */
ok(size.cx == (127000 / dpi_x) &&
size.cy == (50800 / dpi_y), "size = {%d %d} (expected %d %d)\n",
size.cx, size.cy, 127000 / dpi_x, 50800 / dpi_y);
/* Default size is 50x20 pixels, in himetric units */
expected.cx = MulDiv( 50, 2540, dpi_x );
expected.cy = MulDiv( 20, 2540, dpi_y );
ok(size.cx == expected.cx && size.cy == expected.cy, "size = {%d %d} (expected %d %d)\n",
size.cx, size.cy, expected.cx, expected.cy );
size.cx = 800;
size.cy = 700;