From 00aeadc6b66f26ea4b57a2faba38ea913557f491 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 17 Jan 2014 16:09:21 -0700 Subject: [PATCH] oleaut32: Fix OLEFontImpl_SetRatio return when either cyLogical or cyHimetric are 0. --- dlls/oleaut32/olefont.c | 2 +- dlls/oleaut32/tests/olefont.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c index 3155fc32188..bf6995045b6 100644 --- a/dlls/oleaut32/olefont.c +++ b/dlls/oleaut32/olefont.c @@ -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 */ diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c index 5249b54c487..0eab729d910 100644 --- a/dlls/oleaut32/tests/olefont.c +++ b/dlls/oleaut32/tests/olefont.c @@ -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); -- 2.11.4.GIT