Nikolay Sivov : dwrite: Return CreateStreamFromKey() failure code from Analyze().

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 30 10:12:58 CDT 2015


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Mar 30 11:57:28 2015 +0300

dwrite: Return CreateStreamFromKey() failure code from Analyze().

---

 dlls/dwrite/font.c       | 6 ++++--
 dlls/dwrite/tests/font.c | 5 ++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 59eda80..fc067a5 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1715,10 +1715,12 @@ HRESULT create_font_collection(IDWriteFactory2* factory, IDWriteFontFileEnumerat
         if (FAILED(hr))
             break;
 
+        /* failed font files are skipped */
         hr = IDWriteFontFile_Analyze(file, &supported, &file_type, &face_type, &face_count);
         if (FAILED(hr) || !supported || face_count == 0) {
-            TRACE("unsupported font (0x%08x, %d, %u)\n", hr, supported, face_count);
+            TRACE("unsupported font (%p, 0x%08x, %d, %u)\n", file, hr, supported, face_count);
             IDWriteFontFile_Release(file);
+            hr = S_OK;
             continue;
         }
 
@@ -2080,7 +2082,7 @@ static HRESULT WINAPI dwritefontfile_Analyze(IDWriteFontFile *iface, BOOL *isSup
 
     hr = IDWriteFontFileLoader_CreateStreamFromKey(This->loader, This->reference_key, This->key_size, &stream);
     if (FAILED(hr))
-        return S_OK;
+        return hr;
 
     hr = opentype_analyze_font(stream, numberOfFaces, fontFileType, fontFaceType, isSupportedFontType);
 
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index 9762d49..3afcd0c 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -1814,15 +1814,14 @@ static void test_CreateCustomFontFileReference(void)
     face_type = DWRITE_FONT_FACE_TYPE_TRUETYPE;
     support = TRUE;
     count = 1;
-    IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count);
-    ok(hr == S_OK, "got 0x%08x\n", hr);
+    hr = IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count);
+    ok(hr == 0x8faecafe, "got 0x%08x\n", hr);
     ok(support == FALSE, "got %i\n", support);
     ok(file_type == DWRITE_FONT_FILE_TYPE_UNKNOWN, "got %i\n", file_type);
     ok(face_type == DWRITE_FONT_FACE_TYPE_UNKNOWN, "got %i\n", face_type);
     ok(count == 0, "got %i\n", count);
 
     hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, 0, &face);
-todo_wine
     ok(hr == 0x8faecafe, "got 0x%08x\n", hr);
     IDWriteFontFile_Release(file);
 




More information about the wine-cvs mailing list