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

This commit is contained in:
Erich E. Hoover 2014-01-17 16:09:21 -07:00 committed by Alexandre Julliard
parent ba2ce9db49
commit 00aeadc6b6
2 changed files with 5 additions and 8 deletions

View File

@ -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 */

View File

@ -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);