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

Alexandre Julliard julliard at winehq.org
Tue Feb 4 13:55:06 CST 2014


Module: wine
Branch: master
Commit: 00aeadc6b66f26ea4b57a2faba38ea913557f491
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=00aeadc6b66f26ea4b57a2faba38ea913557f491

Author: Erich E. Hoover <erich.e.hoover at gmail.com>
Date:   Fri Jan 17 16:09:21 2014 -0700

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 3155fc3..bf69950 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 5249b54..0eab729 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);




More information about the wine-cvs mailing list