Fabian Maurer : comctl32/syslink: Properly handle '\r'.
Alexandre Julliard
julliard at winehq.org
Mon Apr 20 15:01:47 CDT 2020
Module: wine
Branch: oldstable
Commit: 583feb4b7cc2c04a78f91a24eeae1b79c67d1ec1
URL: https://source.winehq.org/git/wine.git/?a=commit;h=583feb4b7cc2c04a78f91a24eeae1b79c67d1ec1
Author: Fabian Maurer <dark.shadow4 at web.de>
Date: Sun Sep 1 15:23:36 2019 +0200
comctl32/syslink: Properly handle '\r'.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46421
Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 04f75040ec0da9b3992d68790e60bfd5893a306f)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/comctl32/syslink.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c
index cd9d5311fd..464bcc624d 100644
--- a/dlls/comctl32/syslink.c
+++ b/dlls/comctl32/syslink.c
@@ -566,12 +566,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--;
@@ -654,6 +654,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++;
More information about the wine-cvs
mailing list