Commit c69be3bf authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Clean QueryInterface() method, turn impl. calls to interface calls.

parent 92054ef0
...@@ -476,32 +476,42 @@ static HRESULT WINAPI OLEFontImpl_QueryInterface( ...@@ -476,32 +476,42 @@ static HRESULT WINAPI OLEFontImpl_QueryInterface(
*ppvObject = 0; *ppvObject = 0;
if (IsEqualGUID(&IID_IUnknown, riid)) if (IsEqualGUID(&IID_IUnknown, riid) ||
*ppvObject = this; IsEqualGUID(&IID_IFont, riid))
if (IsEqualGUID(&IID_IFont, riid)) {
*ppvObject = this; *ppvObject = this;
if (IsEqualGUID(&IID_IDispatch, riid)) }
*ppvObject = &this->IDispatch_iface; else if (IsEqualGUID(&IID_IDispatch, riid) ||
if (IsEqualGUID(&IID_IFontDisp, riid)) IsEqualGUID(&IID_IFontDisp, riid))
{
*ppvObject = &this->IDispatch_iface; *ppvObject = &this->IDispatch_iface;
if (IsEqualIID(&IID_IPersist, riid) || IsEqualGUID(&IID_IPersistStream, riid)) }
else if (IsEqualGUID(&IID_IPersist, riid) ||
IsEqualGUID(&IID_IPersistStream, riid))
{
*ppvObject = &this->IPersistStream_iface; *ppvObject = &this->IPersistStream_iface;
if (IsEqualGUID(&IID_IConnectionPointContainer, riid)) }
else if (IsEqualGUID(&IID_IConnectionPointContainer, riid))
{
*ppvObject = &this->IConnectionPointContainer_iface; *ppvObject = &this->IConnectionPointContainer_iface;
if (IsEqualGUID(&IID_IPersistPropertyBag, riid)) }
else if (IsEqualGUID(&IID_IPersistPropertyBag, riid))
{
*ppvObject = &this->IPersistPropertyBag_iface; *ppvObject = &this->IPersistPropertyBag_iface;
if (IsEqualGUID(&IID_IPersistStreamInit, riid)) }
else if (IsEqualGUID(&IID_IPersistStreamInit, riid))
{
*ppvObject = &this->IPersistStreamInit_iface; *ppvObject = &this->IPersistStreamInit_iface;
}
/* if (!*ppvObject)
* Check that we obtained an interface.
*/
if ((*ppvObject)==0)
{ {
FIXME("() : asking for unsupported interface %s\n",debugstr_guid(riid)); FIXME("() : asking for unsupported interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE; return E_NOINTERFACE;
} }
OLEFontImpl_AddRef(&this->IFont_iface);
IFont_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -1124,7 +1134,7 @@ static HRESULT WINAPI OLEFontImpl_QueryTextMetrics( ...@@ -1124,7 +1134,7 @@ static HRESULT WINAPI OLEFontImpl_QueryTextMetrics(
HFONT hOldFont, hNewFont; HFONT hOldFont, hNewFont;
hdcRef = GetDC(0); hdcRef = GetDC(0);
OLEFontImpl_get_hFont(iface, &hNewFont); IFont_get_hFont(iface, &hNewFont);
hOldFont = SelectObject(hdcRef, hNewFont); hOldFont = SelectObject(hdcRef, hNewFont);
GetTextMetricsW(hdcRef, ptm); GetTextMetricsW(hdcRef, ptm);
SelectObject(hdcRef, hOldFont); SelectObject(hdcRef, hOldFont);
...@@ -1304,7 +1314,7 @@ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames( ...@@ -1304,7 +1314,7 @@ static HRESULT WINAPI OLEFontImpl_GetIDsOfNames(
if (cNames == 0) return E_INVALIDARG; if (cNames == 0) return E_INVALIDARG;
hres = OLEFontImpl_GetTypeInfo(iface, 0, lcid, &pTInfo); hres = IDispatch_GetTypeInfo(iface, 0, lcid, &pTInfo);
if (FAILED(hres)) if (FAILED(hres))
{ {
ERR("GetTypeInfo failed.\n"); ERR("GetTypeInfo failed.\n");
...@@ -1484,7 +1494,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1484,7 +1494,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPID_FONT_SIZE: case DISPID_FONT_SIZE:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
V_VT(pVarResult) = VT_CY; V_VT(pVarResult) = VT_CY;
return OLEFontImpl_get_Size(&this->IFont_iface, &V_CY(pVarResult)); return IFont_get_Size(&this->IFont_iface, &V_CY(pVarResult));
} else { } else {
VARIANTARG vararg; VARIANTARG vararg;
...@@ -1502,7 +1512,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke( ...@@ -1502,7 +1512,7 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
case DISPID_FONT_WEIGHT: case DISPID_FONT_WEIGHT:
if (wFlags & DISPATCH_PROPERTYGET) { if (wFlags & DISPATCH_PROPERTYGET) {
V_VT(pVarResult) = VT_I2; V_VT(pVarResult) = VT_I2;
return OLEFontImpl_get_Weight(&this->IFont_iface, &V_I2(pVarResult)); return IFont_get_Weight(&this->IFont_iface, &V_I2(pVarResult));
} else { } else {
VARIANTARG vararg; VARIANTARG vararg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment