]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dcpsg.cpp
Patch from Tim Kosse to add supoprt for wxListCtrl::OnGetItemColumnImage
[wxWidgets.git] / src / generic / dcpsg.cpp
index 63d3c4bbab4447e3e8fe25cb6250a1df8a5064df..3f7057b564d04ca9a6763a33d5430ccf24d74490 100644 (file)
@@ -1075,7 +1075,6 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
         double bluePS = (double)(blue) / 255.0;
         double greenPS = (double)(green) / 255.0;
 
-        char buffer[100];
         sprintf( buffer,
             "%.8f %.8f %.8f setrgbcolor\n",
             redPS, greenPS, bluePS );
@@ -1352,7 +1351,6 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
     {
         wxCoord uy = (wxCoord)(y + size - m_underlinePosition);
         wxCoord w, h;
-        char buffer[100];
         GetTextExtent(text, &w, &h);
 
         sprintf( buffer,
@@ -1975,9 +1973,9 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
         //     it just crashes
 #ifndef __WIN32__
         wxPostScriptPrintNativeData *data =
-            (wxPostScriptPrintNativeData *) m_printData.GetNativeData();
+            wxDynamicCast(m_printData.GetNativeData(), wxPostScriptPrintNativeData);
 
-        if (!data->GetFontMetricPath().empty())
+        if (data && !data->GetFontMetricPath().empty())
         {
             afmName = data->GetFontMetricPath();
             afmName << wxFILE_SEP_PATH << name;
@@ -1987,10 +1985,6 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
         if ( !afmName.empty() )
             afmFile = wxFopen(afmName, wxT("r"));
 
-        if ( !afmFile )
-        {
-        }
-
         if ( !afmFile )
         {
 #if defined(__UNIX__) && !defined(__VMS__)