Commit b9307cfa authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Create FontFamily objects only once for the FontCollection.

.Net 4.7+ depends on this behaviour and expects to be able to do pointer equality tests for FontFamily objects. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarVincent Povirk <vincent@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2884da7e
...@@ -141,7 +141,6 @@ static void test_createfont(void) ...@@ -141,7 +141,6 @@ static void test_createfont(void)
expect(Ok, stat); expect(Ok, stat);
stat = GdipGetFamilyName(fontfamily2, familyname, 0); stat = GdipGetFamilyName(fontfamily2, familyname, 0);
expect(Ok, stat); expect(Ok, stat);
todo_wine
ok (fontfamily == fontfamily2, "Unexpected family instance.\n"); ok (fontfamily == fontfamily2, "Unexpected family instance.\n");
ok (lstrcmpiW(Tahoma, familyname) == 0, "Expected Tahoma, got %s\n", ok (lstrcmpiW(Tahoma, familyname) == 0, "Expected Tahoma, got %s\n",
wine_dbgstr_w(familyname)); wine_dbgstr_w(familyname));
...@@ -345,7 +344,6 @@ static void test_fontfamily (void) ...@@ -345,7 +344,6 @@ static void test_fontfamily (void)
ZeroMemory (itsName, sizeof(itsName)); ZeroMemory (itsName, sizeof(itsName));
stat = GdipCloneFontFamily(family, &clonedFontFamily); stat = GdipCloneFontFamily(family, &clonedFontFamily);
expect (Ok, stat); expect (Ok, stat);
todo_wine
ok (family == clonedFontFamily, "Unexpected family instance.\n"); ok (family == clonedFontFamily, "Unexpected family instance.\n");
GdipDeleteFontFamily(family); GdipDeleteFontFamily(family);
stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL); stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL);
...@@ -1238,7 +1236,6 @@ static void test_GdipGetFontCollectionFamilyList(void) ...@@ -1238,7 +1236,6 @@ static void test_GdipGetFontCollectionFamilyList(void)
status = GdipGetFontCollectionFamilyList(collection, 1, &family2, &found); status = GdipGetFontCollectionFamilyList(collection, 1, &family2, &found);
ok(status == Ok, "Failed to get family list, status %d.\n", status); ok(status == Ok, "Failed to get family list, status %d.\n", status);
ok(found == 1, "Unexpected list count %d.\n", found); ok(found == 1, "Unexpected list count %d.\n", found);
todo_wine
ok(family2 == family, "Unexpected family instance.\n"); ok(family2 == family, "Unexpected family instance.\n");
status = GdipDeleteFontFamily(family); status = GdipDeleteFontFamily(family);
...@@ -1338,7 +1335,6 @@ static void test_CloneFont(void) ...@@ -1338,7 +1335,6 @@ static void test_CloneFont(void)
expect(Ok, status); expect(Ok, status);
ret = is_family_in_collection(collection, family); ret = is_family_in_collection(collection, family);
todo_wine
ok(ret, "family is not in collection\n"); ok(ret, "family is not in collection\n");
status = GdipCreateFont(family, 30.0f, FontStyleRegular, UnitPixel, &font); status = GdipCreateFont(family, 30.0f, FontStyleRegular, UnitPixel, &font);
...@@ -1358,7 +1354,6 @@ todo_wine ...@@ -1358,7 +1354,6 @@ todo_wine
status = GdipGetFamily(font, &family2); status = GdipGetFamily(font, &family2);
expect(Ok, status); expect(Ok, status);
todo_wine
ok(family == family2, "got %p\n", family2); ok(family == family2, "got %p\n", family2);
status = GdipCloneFont(font, &font2); status = GdipCloneFont(font, &font2);
...@@ -1378,7 +1373,6 @@ todo_wine ...@@ -1378,7 +1373,6 @@ todo_wine
status = GdipGetFamily(font2, &family2); status = GdipGetFamily(font2, &family2);
expect(Ok, status); expect(Ok, status);
todo_wine
ok(family == family2, "got %p\n", family2); ok(family == family2, "got %p\n", family2);
GdipDeleteFont(font2); GdipDeleteFont(font2);
......
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