From: Torge Matthies tmatthies@codeweavers.com
Signed-off-by: Torge Matthies tmatthies@codeweavers.com --- dlls/gdiplus/graphics.c | 10 ++++++---- dlls/gdiplus/tests/graphics.c | 4 +--- 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 758889eca06..fad2e700fee 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -5245,6 +5245,7 @@ GpStatus gdip_format_string(HDC hdc, if(*(stringdup + sum + lret) == '\n') { unixstyle_newline = TRUE; + lret += 1; break; }
@@ -5252,13 +5253,14 @@ GpStatus gdip_format_string(HDC hdc, && *(stringdup + sum + lret + 1) == '\n') { unixstyle_newline = FALSE; + lret += 2; break; } }
/* Line break code (may look strange, but it imitates windows). */ - if(lret < fit) - lineend = fit = lret; /* this is not an off-by-one error */ + if(lret > 0 && *(stringdup + sum + lret - 1) == '\n') + lineend = fit = lret; else if(fit < (length - sum)){ if(*(stringdup + sum + fit) == ' ') while(*(stringdup + sum + fit) == ' ') @@ -5330,13 +5332,13 @@ GpStatus gdip_format_string(HDC hdc, { height += size.cy; lineno++; - sum += fit + (lret < fitcpy ? 1 : 0); + sum += fit; } else { height += size.cy; lineno++; - sum += fit + (lret < fitcpy ? 2 : 0); + sum += fit; }
hotkeyprefix_pos = hotkeyprefix_end_pos; diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index de3154a6a93..9fcc620d538 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3319,7 +3319,7 @@ static void test_string_functions(void) expect(Ok, status); expectf(0.0, bounds.X); expectf(0.0, bounds.Y); - todo_wine expect(5, codepointsfitted); + expect(5, codepointsfitted); todo_wine expect(1, linesfilled);
/* Cut off everything after the first space. */ @@ -3366,9 +3366,7 @@ static void test_string_functions(void) expectf(0.0, bounds.X); expectf(0.0, bounds.Y); expectf_(3.33, bounds.Width, 0.01); - todo_wine expectf_(char_bounds.Height, bounds.Height, 0.05); - todo_wine expect(1, codepointsfitted); expect(1, linesfilled);