]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dcpsg.cpp
clean - reformatting
[wxWidgets.git] / src / generic / dcpsg.cpp
index d1d7bd66d8162377b8272b69c09c13c573a23fc6..f5dad23ae79f60aca9360a4191be42720c0bd227 100644 (file)
@@ -22,8 +22,6 @@
 
 #if wxUSE_POSTSCRIPT
 
-#include "wx/setup.h"
-
 #include "wx/dcmemory.h"
 #include "wx/utils.h"
 #include "wx/intl.h"
@@ -1973,9 +1971,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;
@@ -1985,10 +1983,6 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
         if ( !afmName.empty() )
             afmFile = wxFopen(afmName, wxT("r"));
 
-        if ( !afmFile )
-        {
-        }
-
         if ( !afmFile )
         {
 #if defined(__UNIX__) && !defined(__VMS__)