<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top"><p dir=ltr></p>
<p dir=ltr><a href="https://mx.overview.mail.yahoo.com/mobile/?.src=Android">Enviado desde Yahoo Mail en Android</a></p>
</td></tr></table>            <div id="_origMsg_">
                <div>
                    <br />
                    <div>
                        <div style="font-size:0.9em">
                            <hr size="1">
                            <b>
                                <span style="font-weight:bold">From:</span>
                            </b>
                            Henri Verbeet <hverbeet@codeweavers.com>;                            <br>
                            <b>
                                <span style="font-weight:bold">To:</span>
                            </b>
                             <wine-patches@winehq.org>;                                                                                                     <br>
                            <b>
                                <span style="font-weight:bold">Subject:</span>
                            </b>
                            [PATCH 1/5] user32: Fix TEXT_WordBreak() when no characters fit.                            <br>
                            <b>
                                <span style="font-weight:bold">Sent:</span>
                            </b>
                            Tue, Mar 11, 2014 5:41:43 PM                            <br>
                        </div>
                            <br>
                            <table cellspacing="0" cellpadding="0" border="0">
                                <tbody>
                                    <tr>
                                        <td valign="top">---<BR> dlls/user32/tests/text.c |   16 ++++++++++++++++<BR> dlls/user32/text.c       |    4 ++--<BR> 2 files changed, 18 insertions(+), 2 deletions(-)<BR><BR>diff --git a/dlls/user32/tests/text.c b/dlls/user32/tests/text.c<BR>index 217baab..19bcd72 100644<BR>--- a/dlls/user32/tests/text.c<BR>+++ b/dlls/user32/tests/text.c<BR>@@ -42,6 +42,8 @@ static void test_DrawTextCalcRect(void)<BR>         's','t','r','i','n','g','\0'};<BR>     static CHAR emptystring[] = "";<BR>     static WCHAR emptystringW[] = { 0 };<BR>+    static CHAR wordbreak_text[] = "line1 line2";<BR>+    static WCHAR wordbreak_textW[] = {'l','i','n','e','1',' ','l','i','n','e','2',0};<BR>     INT textlen, textheight, heightcheck;<BR>     RECT rect = { 0, 0, 100, 0 };<BR>     BOOL ret;<BR>@@ -556,6 +558,20 @@ static
 void test_DrawTextCalcRect(void)<BR>         ok(rect.bottom, "rect.bottom should not be 0\n");<BR>     }<BR> <BR>+    SetRect(&rect, 0, 0, 1, 1);<BR>+    heightcheck = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT);<BR>+    SetRect(&rect, 0, 0, 1, 1);<BR>+    textheight = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT | DT_WORDBREAK);<BR>+    ok(textheight == heightcheck * 2, "Got unexpected textheight %d, expected %d.\n",<BR>+       textheight, heightcheck * 2);<BR>+<BR>+    SetRect(&rect, 0, 0, 1, 1);<BR>+    heightcheck = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT);<BR>+    SetRect(&rect, 0, 0, 1, 1);<BR>+    textheight = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT | DT_WORDBREAK);<BR>+    ok(textheight == heightcheck * 2, "Got unexpected
 textheight %d, expected %d.\n",<BR>+       textheight, heightcheck * 2);<BR>+<BR>     SelectObject(hdc, hOldFont);<BR>     ret = DeleteObject(hFont);<BR>     ok( ret, "DeleteObject error %u\n", GetLastError());<BR>diff --git a/dlls/user32/text.c b/dlls/user32/text.c<BR>index 7bef476..fdc3554 100644<BR>--- a/dlls/user32/text.c<BR>+++ b/dlls/user32/text.c<BR>@@ -379,7 +379,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,<BR>     i = chars_fit;<BR>     word_fits = TRUE;<BR>     if (!chars_fit)<BR>-        ; /* we pretend that it fits anyway */<BR>+        word_fits = FALSE;<BR>     else if (sla[i].fSoftBreak) /* chars_fit < *len_str so this is valid */<BR>     {<BR>          /* the word just fitted */<BR>@@ -392,7 +392,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR
 *str, unsigned int max_str,<BR>         word_fits = (i != 0 || sla[i+1].fSoftBreak );<BR>     }<BR> <BR>-    /* If there was one or the first character didn't fit then */<BR>+    /* If there was one. */<BR>     if (word_fits)<BR>     {<BR>         BOOL next_is_space;<BR>-- <BR>1.7.10.4<BR><BR><BR><BR></td>
                                    </tr>
                                </tbody>
                            </table>
                    </div>
                </div>
            </div>