[2/2] gdi32: disallow dashed style on non-extended wide pens [try2]

Evan Stade estade at gmail.com
Wed Jul 18 21:40:31 CDT 2007


Hi,

[try2] resubmit.

 dlls/gdi32/pen.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdi32/pen.c b/dlls/gdi32/pen.c
index fb84788..2167624 100644
--- a/dlls/gdi32/pen.c
+++ b/dlls/gdi32/pen.c
@@ -85,7 +85,11 @@ HPEN WINAPI CreatePenIndirect( const LOG
 
     if (!(penPtr = GDI_AllocObject( sizeof(PENOBJ), PEN_MAGIC, (HGDIOBJ *)&hpen,
 				    &pen_funcs ))) return 0;
-    if (pen->lopnStyle == PS_USERSTYLE || pen->lopnStyle == PS_ALTERNATE)
+    /* If width is more than 1 style must be PS_NULL, PS_SOLID, or PS_INSIDEFRAME.
+     * Also, PS_ALTERNATE and PS_USERSTYLE are not permitted for non-extended pens.*/
+    if (((pen->lopnWidth.x >= 1) &&
+        !(pen->lopnStyle == PS_NULL || pen->lopnStyle == PS_SOLID || pen->lopnStyle == PS_INSIDEFRAME))
+        || (pen->lopnStyle == PS_USERSTYLE || pen->lopnStyle == PS_ALTERNATE))
         penPtr->logpen.elpPenStyle = PS_SOLID;
     else
         penPtr->logpen.elpPenStyle = pen->lopnStyle;
-- 
1.4.1


More information about the wine-patches mailing list