gdiplus: Fix the linesfilled calculation in GdipMeasureString.
authorVincent Povirk <vincent@codeweavers.com>
Tue, 30 Mar 2010 19:22:06 +0000 (14:22 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 31 Mar 2010 09:40:08 +0000 (11:40 +0200)
dlls/gdiplus/graphics.c
dlls/gdiplus/tests/graphics.c

index e8c4d0afbe00b92eded37b22e41e1b7661c4d73a..f6f5812a94cc4c633cf4043db797cb90adf8773d 100644 (file)
@@ -3516,7 +3516,7 @@ static GpStatus measure_string_callback(GpGraphics *graphics,
         *args->codepointsfitted = index + length;
 
     if (args->linesfilled)
-        *args->linesfilled += bounds->Height;
+        (*args->linesfilled)++;
 
     return Ok;
 }
index 959fbb0f9c62e1657d4142756eed43bb764423a6..0a6490e43acedfa962b5adb6763034f8e50a65d0 100644 (file)
@@ -2490,7 +2490,7 @@ static void test_string_functions(void)
     ok(char_bounds.Width > 0, "got %0.2f\n", bounds.Width);
     ok(char_bounds.Height > 0, "got %0.2f\n", bounds.Height);
     expect(1, codepointsfitted);
-    todo_wine expect(1, linesfilled);
+    expect(1, linesfilled);
 
     status = GdipMeasureString(graphics, teststring, 2, font, &rc, NULL, &bounds, &codepointsfitted, &linesfilled);
     expect(Ok, status);
@@ -2499,7 +2499,7 @@ static void test_string_functions(void)
     ok(bounds.Width > char_bounds.Width, "got %0.2f, expected at least %0.2f\n", bounds.Width, char_bounds.Width);
     expectf(char_bounds.Height, bounds.Height);
     expect(2, codepointsfitted);
-    todo_wine expect(1, linesfilled);
+    expect(1, linesfilled);
     char_width = bounds.Width - char_bounds.Width;
 
     status = GdipMeasureString(graphics, teststring, 6, font, &rc, NULL, &bounds, &codepointsfitted, &linesfilled);
@@ -2509,7 +2509,7 @@ static void test_string_functions(void)
     expectf_(char_bounds.Width + char_width * 3, bounds.Width, 0.01);
     ok(bounds.Height > char_bounds.Height, "got %0.2f, expected at least %0.2f\n", bounds.Height, char_bounds.Height);
     expect(6, codepointsfitted);
-    todo_wine expect(2, linesfilled);
+    expect(2, linesfilled);
     char_height = bounds.Height - char_bounds.Height;
 
     /* Cut off everything after the first space. */
@@ -2522,7 +2522,7 @@ static void test_string_functions(void)
     expectf_(char_bounds.Width + char_width, bounds.Width, 0.01);
     expectf_(char_bounds.Height + char_height * 2, bounds.Height, 0.01);
     expect(6, codepointsfitted);
-    todo_wine expect(3, linesfilled);
+    expect(3, linesfilled);
 
     /* Cut off everything including the first space. */
     rc.Width = char_bounds.Width + char_width * 1.5;
@@ -2534,7 +2534,7 @@ static void test_string_functions(void)
     expectf_(char_bounds.Width + char_width, bounds.Width, 0.01);
     expectf_(char_bounds.Height + char_height * 2, bounds.Height, 0.01);
     expect(6, codepointsfitted);
-    todo_wine expect(3, linesfilled);
+    expect(3, linesfilled);
 
     /* Cut off everything after the first character. */
     rc.Width = char_bounds.Width + char_width * 0.5;