Commit 3c49e3e4 authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

gdi32: Handle 0 count in GetCharacterPlacementW.

parent 7ef3d801
......@@ -3313,6 +3313,9 @@ GetCharacterPlacementW(
TRACE("%s, %d, %d, 0x%08x\n",
debugstr_wn(lpString, uCount), uCount, nMaxExtent, dwFlags);
if (!uCount)
return 0;
if (!lpResults)
return GetTextExtentPoint32W(hdc, lpString, uCount, &size) ? MAKELONG(size.cx, size.cy) : 0;
......
......@@ -4951,9 +4951,9 @@ static void test_GetCharacterPlacement(void)
result.nGlyphs = 20;
size2 = GetCharacterPlacementA(hdc, "Wine Test", 0, 0, &result, 0);
ok(!size2, "Expected GetCharacterPlacementA to fail\n");
todo_wine ok(result.nGlyphs == 20, "Unexpected number of glyphs %u\n", result.nGlyphs);
ok(result.nGlyphs == 20, "Unexpected number of glyphs %u\n", result.nGlyphs);
ok(glyphs[0] == '!', "Unexpected first glyph %s\n", wine_dbgstr_wn(glyphs, 1));
todo_wine ok(pos[0] == -1, "Unexpected caret position %d\n", pos[0]);
ok(pos[0] == -1, "Unexpected caret position %d\n", pos[0]);
size2 = GetCharacterPlacementA(hdc, "Wine Test", 9, 0, NULL, 0);
ok(size2, "GetCharacterPlacementA failed!\n");
......
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