Commit 00aeadc6 authored by Erich E. Hoover's avatar Erich E. Hoover Committed by Alexandre Julliard

oleaut32: Fix OLEFontImpl_SetRatio return when either cyLogical or cyHimetric are 0.

parent ba2ce9db
......@@ -1083,7 +1083,7 @@ static HRESULT WINAPI OLEFontImpl_SetRatio(
TRACE("(%p)->(%d, %d)\n", this, cyLogical, cyHimetric);
if(cyLogical == 0 || cyHimetric == 0)
return E_INVALIDARG;
return E_FAIL;
/* cyLogical and cyHimetric both set to 1 is a special case that
does not change the scaling but also does not fail */
......
......@@ -88,13 +88,10 @@ static void test_ifont_size(LONG lo_size, LONG hi_size,
test_name, hres);
ok(pvObj != NULL,"%s: OCFI returns NULL.\n", test_name);
/* If scaling ration specified, change ratio. */
if(ratio_logical && ratio_himetric)
{
hres = IFont_SetRatio(ifnt, ratio_logical, ratio_himetric);
ok(hres == S_OK,"%s: IFont_SetRatio returns 0x%08x instead of S_OK.\n",
test_name, hres);
}
/* Change the scaling ratio */
hres = IFont_SetRatio(ifnt, ratio_logical, ratio_himetric);
ok((ratio_logical && ratio_himetric) ? hres == S_OK : hres == E_FAIL,
"%s: IFont_SetRatio unexpectedly returned 0x%08x.\n", test_name, hres);
/* Read back size. */
hres = IFont_get_Size(ifnt, &psize);
......
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