[Wine-patches] [eter-2.1 1/7] Revert "gdiplus: Add support for StringFormatFlagsNoClip.". (eterbug #9086)

Dmitry Timoshkov dtimoshkov на etersoft.ru
Пн Мар 18 07:40:41 MSK 2013


This reverts commit bfa35f37a7687cdae338ad9837fc595afb2df2b6.
This patch breaks string alignment.

(cherry picked from commit 737790603cc1dd6697ec4b8fbd0c24a002904214)
---
 dlls/gdiplus/graphics.c | 33 +++++----------------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index f585b47..24e2c5a 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -4679,16 +4679,8 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
 
     scaled_rect.X = (layoutRect->X + margin_x) * args.rel_width;
     scaled_rect.Y = layoutRect->Y * args.rel_height;
-    if (stringFormat->attr & StringFormatFlagsNoClip)
-    {
-        scaled_rect.Width = (REAL)(1 << 23);
-        scaled_rect.Height = (REAL)(1 << 23);
-    }
-    else
-    {
-        scaled_rect.Width = layoutRect->Width * args.rel_width;
-        scaled_rect.Height = layoutRect->Height * args.rel_height;
-    }
+    scaled_rect.Width = layoutRect->Width * args.rel_width;
+    scaled_rect.Height = layoutRect->Height * args.rel_height;
     if (scaled_rect.Width >= 0.5)
     {
         scaled_rect.Width -= margin_x * 2.0 * args.rel_width;
@@ -4768,7 +4760,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
     GpPointF pt[3];
     RectF scaled_rect;
     REAL margin_x;
-    INT lines, glyphs, format_flags = format ? format->attr : 0;
+    INT lines, glyphs;
 
     TRACE("(%p, %s, %i, %p, %s, %p, %p, %p, %p)\n", graphics,
         debugstr_wn(string, length), length, font, debugstr_rectf(rect), format,
@@ -4810,12 +4802,6 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
     scaled_rect.Y = rect->Y * args.rel_height;
     scaled_rect.Width = rect->Width * args.rel_width;
     scaled_rect.Height = rect->Height * args.rel_height;
-
-    if ((format_flags & StringFormatFlagsNoClip) ||
-        scaled_rect.Width >= 1 << 23 || scaled_rect.Width < 0.5) scaled_rect.Width = 1 << 23;
-    if ((format_flags & StringFormatFlagsNoClip) ||
-        scaled_rect.Height >= 1 << 23 || scaled_rect.Height < 0.5) scaled_rect.Height = 1 << 23;
-
     if (scaled_rect.Width >= 0.5)
     {
         scaled_rect.Width -= margin_x * 2.0 * args.rel_width;
@@ -4918,7 +4904,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
     GpPointF pt[3], rectcpy[4];
     POINT corners[4];
     REAL rel_width, rel_height, margin_x;
-    INT save_state, format_flags = 0;
+    INT save_state;
     REAL offsety = 0.0;
     struct draw_string_args args;
     RectF scaled_rect;
@@ -4943,8 +4929,6 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
     if(format){
         TRACE("may be ignoring some format flags: attr %x\n", format->attr);
 
-        format_flags = format->attr;
-
         /* Should be no need to explicitly test for StringAlignmentNear as
          * that is default behavior if no alignment is passed. */
         if(format->vertalign != StringAlignmentNear){
@@ -4989,12 +4973,6 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
     scaled_rect.Y = 0.0;
     scaled_rect.Width = rel_width * rect->Width;
     scaled_rect.Height = rel_height * rect->Height;
-
-    if ((format_flags & StringFormatFlagsNoClip) ||
-        scaled_rect.Width >= 1 << 23 || scaled_rect.Width < 0.5) scaled_rect.Width = 1 << 23;
-    if ((format_flags & StringFormatFlagsNoClip) ||
-        scaled_rect.Height >= 1 << 23 || scaled_rect.Height < 0.5) scaled_rect.Height = 1 << 23;
-
     if (scaled_rect.Width >= 0.5)
     {
         scaled_rect.Width -= margin_x * 2.0 * rel_width;
@@ -5004,8 +4982,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
     if (scaled_rect.Width >= 1 << 23 || scaled_rect.Width < 0.5) scaled_rect.Width = 1 << 23;
     if (scaled_rect.Height >= 1 << 23 || scaled_rect.Height < 0.5) scaled_rect.Height = 1 << 23;
 
-    if (!(format_flags & StringFormatFlagsNoClip) &&
-        scaled_rect.Width != 1 << 23 && scaled_rect.Height != 1 << 23)
+    if (scaled_rect.Width != 1 << 23 && scaled_rect.Height != 1 << 23)
     {
         /* FIXME: If only the width or only the height is 0, we should probably still clip */
         rgn = CreatePolygonRgn(corners, 4, ALTERNATE);
-- 
1.8.2



Подробная информация о списке рассылки Wine-patches