dhtmled.ocx: Implement IOleObject::SetExtent and IOleObject::GetExtent functions.

This time without tests as the ocx file is not available from windows 7 &
IE 8

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50697
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Vijay Kiran Kamuju 2021-03-10 21:30:28 +01:00 committed by Alexandre Julliard
parent 195c57eeb7
commit 6ca1a92684
2 changed files with 27 additions and 5 deletions

View File

@ -1,5 +1,5 @@
MODULE = dhtmled.ocx
IMPORTS = uuid ole32
IMPORTS = uuid ole32 user32 gdi32
EXTRADLLFLAGS = -mno-cygwin

View File

@ -1,5 +1,6 @@
/*
* Copyright 2017 Alex Henrie
* Copyright 2021 Vijay Kiran Kamuju
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -30,6 +31,7 @@ typedef struct
IOleObject IOleObject_iface;
IPersistStreamInit IPersistStreamInit_iface;
IOleClientSite *client_site;
SIZEL extent;
LONG ref;
} DHTMLEditImpl;
@ -700,15 +702,25 @@ static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD type_type,
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
{
DHTMLEditImpl *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
return E_NOTIMPL;
TRACE("(%p)->(%u, %p)\n", This, aspect, size_limit);
if(aspect != DVASPECT_CONTENT)
return DV_E_DVASPECT;
This->extent = *size_limit;
return S_OK;
}
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
{
DHTMLEditImpl *This = impl_from_IOleObject(iface);
FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
return E_NOTIMPL;
TRACE("(%p)->(%u, %p)\n", This, aspect, size_limit);
if(aspect != DVASPECT_CONTENT)
return E_FAIL;
*size_limit = This->extent;
return S_OK;
}
static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *sink, DWORD *conn)
@ -849,6 +861,8 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
HRESULT dhtml_edit_create(REFIID iid, void **out)
{
DHTMLEditImpl *This;
DWORD dpi_x, dpi_y;
HDC hdc;
HRESULT ret;
TRACE("(%s, %p)\n", debugstr_guid(iid), out);
@ -863,6 +877,14 @@ HRESULT dhtml_edit_create(REFIID iid, void **out)
This->client_site = NULL;
This->ref = 1;
hdc = GetDC(0);
dpi_x = GetDeviceCaps(hdc, LOGPIXELSX);
dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(0, hdc);
This->extent.cx = MulDiv(192, 2540, dpi_x);
This->extent.cy = MulDiv(192, 2540, dpi_y);
ret = IDHTMLEdit_QueryInterface(&This->IDHTMLEdit_iface, iid, out);
IDHTMLEdit_Release(&This->IDHTMLEdit_iface);
return ret;