Skip to content
Snippets Groups Projects
Commit f54a1dac authored by Jinoh Kang's avatar Jinoh Kang Committed by Alexandre Julliard
Browse files

riched20/tests: Don't specify DT_WORDBREAK in _check_txgetnaturalsize().

Today, test_TxGetNaturalSize() creates a pop-up window with a fixed size
(extent) of 100 x 100.  The test function then proceeds to compute the
natural size of rich edit control that fits the sample text
"TestSomeText" and compare it to the RECT calculated by DrawText.

Apparently, this test fails if the width of the sample text
"TestSomeText" exceeds the width of the test window's client area.  In
this case, DrawText() with DT_WORDBREAK breaks the text into the two
lines due to text wrapping; however, Rich Edit's
ITextServices::TxGetNaturalSize implementation does not seem to perform
text wrapping on overflow.  This results in extent mismatch.

(Note that the test may either succeed or fail depending on the current
font used for DEFAULT_GUI_FONT, which defaults to Tahoma according to
Microsoft's documentation.  To reproduce this failure, it may be
necessary to switch fonts or change the width of the pop-up window.)

Fix this by omitting the DT_WORDBREAK flag for the DrawText() call in
_check_txgetnaturalsize().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54637
parent eca1e4ea
No related branches found
No related tags found
No related merge requests found
......@@ -753,7 +753,7 @@ static void _check_txgetnaturalsize(HRESULT res, LONG width, LONG height, HDC hd
RECT expected_rect = rect;
LONG expected_width, expected_height;
DrawTextW(hdc, string, -1, &expected_rect, DT_LEFT | DT_CALCRECT | DT_NOCLIP | DT_EDITCONTROL | DT_WORDBREAK);
DrawTextW(hdc, string, -1, &expected_rect, DT_LEFT | DT_CALCRECT | DT_NOCLIP | DT_EDITCONTROL);
expected_width = expected_rect.right - expected_rect.left;
expected_height = expected_rect.bottom - expected_rect.top;
ok_(__FILE__,line)(res == S_OK, "ITextServices_TxGetNaturalSize failed: 0x%08lx.\n", res);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment