]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/pen.cpp
don't create m_dottedPen with an invalid 0 style which results in an assert under MSW
[wxWidgets.git] / src / msw / pen.cpp
index cd58107ac920e8af06c99847aea9b575545d190e..a43d02b14da772621f964ea08f6fdd714d384038 100644 (file)
@@ -206,18 +206,10 @@ wxPenRefData::~wxPenRefData()
 // wxPenRefData HPEN management
 // ----------------------------------------------------------------------------
 
-#ifdef wxHAVE_EXT_CREATE_PEN
-
 static int ConvertPenStyle(int style)
 {
     switch ( style )
     {
-        case wxDOT:
-            return PS_DOT;
-
-        case wxDOT_DASH:
-            return PS_DASHDOT;
-
         case wxSHORT_DASH:
         case wxLONG_DASH:
             return PS_DASH;
@@ -225,13 +217,20 @@ static int ConvertPenStyle(int style)
         case wxTRANSPARENT:
             return PS_NULL;
 
-        case wxUSER_DASH:
-            return PS_USERSTYLE;
-
         default:
             wxFAIL_MSG( _T("unknown pen style") );
             // fall through
 
+#ifdef wxHAVE_EXT_CREATE_PEN
+        case wxDOT:
+            return PS_DOT;
+
+        case wxDOT_DASH:
+            return PS_DASHDOT;
+
+        case wxUSER_DASH:
+            return PS_USERSTYLE;
+
         case wxSTIPPLE:
         case wxBDIAGONAL_HATCH:
         case wxCROSSDIAG_HATCH:
@@ -240,10 +239,14 @@ static int ConvertPenStyle(int style)
         case wxHORIZONTAL_HATCH:
         case wxVERTICAL_HATCH:
         case wxSOLID:
+#endif // wxHAVE_EXT_CREATE_PEN
+
             return PS_SOLID;
     }
 }
 
+#ifdef wxHAVE_EXT_CREATE_PEN
+
 static int ConvertJoinStyle(int join)
 {
     switch( join )