Module: wine Branch: master Commit: acc4623fd07e2f9e2a72184b62f9b59b3b2734a4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=acc4623fd07e2f9e2a72184b62...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Tue Aug 21 11:02:13 2012 +0900
gdiplus: Use set_rect_empty() helper to make the code slightly more compact and readable.
---
dlls/gdiplus/tests/graphics.c | 24 +++++++++--------------- 1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 8c55abe..b007ddf 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3445,7 +3445,7 @@ static void test_GdipMeasureString(void) GpFontFamily *family; GpFont *font; GpStringFormat *format; - RectF bounds, rc, empty_rc = { 0.0, 0.0, 0.0, 0.0 }; + RectF bounds, rc; REAL base_cx = 0, base_cy = 0, height; INT chars, lines; LOGFONTW lf; @@ -3492,8 +3492,8 @@ static void test_GdipMeasureString(void)
height = font_size * font_to_pixel_scale;
- rc = empty_rc; - bounds = empty_rc; + set_rect_empty(&rc); + set_rect_empty(&bounds); status = GdipMeasureString(graphics, string, -1, font, &rc, format, &bounds, &chars, &lines); expect(Ok, status);
@@ -3516,7 +3516,7 @@ static void test_GdipMeasureString(void) rc = bounds; rc.X = 50.0; rc.Y = 50.0; - bounds = empty_rc; + set_rect_empty(&bounds); status = GdipMeasureString(graphics, string, -1, font, &rc, format, &bounds, &chars, &lines); expect(Ok, status); expectf(50.0, bounds.X); @@ -3574,8 +3574,8 @@ static void test_GdipMeasureString(void) height /= td[i].page_scale; /*trace("%u: %.1f font units = %f units with %.1f dpi, page_scale %.1f\n", i, font_size, height, td[i].res_y, td[i].page_scale);*/
- rc = empty_rc; - bounds = empty_rc; + set_rect_empty(&rc); + set_rect_empty(&bounds); status = GdipMeasureString(graphics, string, -1, font, &rc, format, &bounds, &chars, &lines); expect(Ok, status);
@@ -3598,7 +3598,7 @@ static void test_GdipMeasureString(void) rc = bounds; rc.X = 50.0; rc.Y = 50.0; - bounds = empty_rc; + set_rect_empty(&bounds); status = GdipMeasureString(graphics, string, -1, font, &rc, format, &bounds, &chars, &lines); expect(Ok, status); expectf(50.0, bounds.X); @@ -3749,14 +3749,8 @@ static void test_font_height_scaling(void) status = GdipSetPageUnit(graphics, gfx_unit); expect(Ok, status);
- rect.X = 0.0; - rect.Y = 0.0; - rect.Width = 0; - rect.Height = 0; - bounds.X = 0.0; - bounds.Y = 0.0; - bounds.Width = 0; - bounds.Height = 0; + set_rect_empty(&rect); + set_rect_empty(&bounds); status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, NULL, NULL); expect(Ok, status);