]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dcpsg.cpp
removed useless colMapAllocCounter (patch 1413456)
[wxWidgets.git] / src / generic / dcpsg.cpp
index f5dad23ae79f60aca9360a4191be42720c0bd227..ff50f091200aae35f2bd34c6da71bbf97072b747 100644 (file)
@@ -872,14 +872,14 @@ void wxPostScriptDC::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y,
 
     unsigned char* data = image.GetData();
 
-    /* buffer = line = width*rgb(3)*hexa(2)+'\n'(1)+null(1) */
-    char* buffer = new char[ w*6+2 ];
+    // size of the buffer = width*rgb(3)*hexa(2)+'\n'
+    wxCharBuffer buffer(w*6 + 1);
     int firstDigit, secondDigit;
 
     //rows
     for (int j = 0; j < h; j++)
     {
-        char* bufferindex = buffer;
+        char* bufferindex = buffer.data();
 
         //cols
         for (int i = 0; i < w*3; i++)
@@ -1037,12 +1037,26 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
         case wxSHORT_DASH:    psdash = short_dashed;   break;
         case wxLONG_DASH:     psdash = wxCoord_dashed; break;
         case wxDOT_DASH:      psdash = dotted_dashed;  break;
+        case wxUSER_DASH:
+        {
+            wxDash *dashes;
+            int nDashes = m_pen.GetDashes (&dashes);
+            PsPrint ("[");
+            for (int i = 0; i < nDashes; ++i)
+            {
+                sprintf( buffer, "%d ", dashes [i] );
+                PsPrint( buffer );
+            }
+            PsPrint ("] 0 setdash\n");
+            psdash = 0; 
+        } 
+        break;
         case wxSOLID:
         case wxTRANSPARENT:
         default:              psdash = "[] 0";         break;
     }
 
-    if ( (oldStyle != m_pen.GetStyle()) )
+    if ( psdash && (oldStyle != m_pen.GetStyle()) )
     {
         PsPrint( psdash );
         PsPrint( " setdash\n" );