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:
parent
195c57eeb7
commit
6ca1a92684
|
@ -1,5 +1,5 @@
|
||||||
MODULE = dhtmled.ocx
|
MODULE = dhtmled.ocx
|
||||||
IMPORTS = uuid ole32
|
IMPORTS = uuid ole32 user32 gdi32
|
||||||
|
|
||||||
EXTRADLLFLAGS = -mno-cygwin
|
EXTRADLLFLAGS = -mno-cygwin
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2017 Alex Henrie
|
* Copyright 2017 Alex Henrie
|
||||||
|
* Copyright 2021 Vijay Kiran Kamuju
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -30,6 +31,7 @@ typedef struct
|
||||||
IOleObject IOleObject_iface;
|
IOleObject IOleObject_iface;
|
||||||
IPersistStreamInit IPersistStreamInit_iface;
|
IPersistStreamInit IPersistStreamInit_iface;
|
||||||
IOleClientSite *client_site;
|
IOleClientSite *client_site;
|
||||||
|
SIZEL extent;
|
||||||
LONG ref;
|
LONG ref;
|
||||||
} DHTMLEditImpl;
|
} 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)
|
static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
|
||||||
{
|
{
|
||||||
DHTMLEditImpl *This = impl_from_IOleObject(iface);
|
DHTMLEditImpl *This = impl_from_IOleObject(iface);
|
||||||
FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
|
TRACE("(%p)->(%u, %p)\n", This, aspect, size_limit);
|
||||||
return E_NOTIMPL;
|
|
||||||
|
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)
|
static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD aspect, SIZEL *size_limit)
|
||||||
{
|
{
|
||||||
DHTMLEditImpl *This = impl_from_IOleObject(iface);
|
DHTMLEditImpl *This = impl_from_IOleObject(iface);
|
||||||
FIXME("(%p)->(%u, %p) stub\n", This, aspect, size_limit);
|
TRACE("(%p)->(%u, %p)\n", This, aspect, size_limit);
|
||||||
return E_NOTIMPL;
|
|
||||||
|
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)
|
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)
|
HRESULT dhtml_edit_create(REFIID iid, void **out)
|
||||||
{
|
{
|
||||||
DHTMLEditImpl *This;
|
DHTMLEditImpl *This;
|
||||||
|
DWORD dpi_x, dpi_y;
|
||||||
|
HDC hdc;
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
|
|
||||||
TRACE("(%s, %p)\n", debugstr_guid(iid), out);
|
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->client_site = NULL;
|
||||||
This->ref = 1;
|
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);
|
ret = IDHTMLEdit_QueryInterface(&This->IDHTMLEdit_iface, iid, out);
|
||||||
IDHTMLEdit_Release(&This->IDHTMLEdit_iface);
|
IDHTMLEdit_Release(&This->IDHTMLEdit_iface);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue