Commit 04f75040 authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

comctl32/syslink: Properly handle '\r'.

parent 2f9e6c0c
......@@ -565,12 +565,12 @@ static BOOL SYSLINK_WrapLine (LPWSTR Text, WCHAR BreakChar, int x, int *LineLen,
{
int i;
for (i = 0; i < nFit; i++) if (Text[i] == '\n') break;
for (i = 0; i < nFit; i++) if (Text[i] == '\r' || Text[i] == '\n') break;
if (i == *LineLen) return FALSE;
/* check if we're in the middle of a word */
if (Text[i] != '\n' && Text[i] != BreakChar)
if (Text[i] != '\r' && Text[i] != '\n' && Text[i] != BreakChar)
{
/* search for the beginning of the word */
while (i && Text[i - 1] != BreakChar) i--;
......@@ -653,6 +653,12 @@ static VOID SYSLINK_Render (const SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
/* skip break characters unless they're the first of the doc item */
if(tx != Current->Text || x == SL_LEFTMARGIN)
{
if (n && *tx == '\r')
{
tx++;
SkipChars++;
n--;
}
if (n && *tx == '\n')
{
tx++;
......
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