]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dcpsg.cpp
fixed compilation problem in pror commit
[wxWidgets.git] / src / generic / dcpsg.cpp
index a93dffc55a76f34c9c4e4ecc2aa1c70ff4711f9a..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;