]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/cmndata.cpp
Correct mistakes in wxStripExtension - correct wxString::npos. Spurred by 1073642...
[wxWidgets.git] / src / common / cmndata.cpp
index d75430ee5d4d728138cede0256b91da5462c405e..37e2d98304849dc8c2b390cbece5cb6c44bcbfe5 100644 (file)
@@ -190,6 +190,7 @@ wxPrintData::wxPrintData()
 wxPrintData::wxPrintData(const wxPrintData& printData)
     : wxObject()
 {
+    m_nativeData = NULL;
     (*this) = printData;
 }
 
@@ -237,10 +238,13 @@ void wxPrintData::operator=(const wxPrintData& data)
     m_printMode = data.m_printMode;
     m_filename = data.m_filename;   
 
-    // UnRef old m_nativeData    
-    m_nativeData->m_ref--;
-    if (m_nativeData->m_ref == 0) 
-        delete m_nativeData;
+    // UnRef old m_nativeData   
+    if (m_nativeData)
+    {
+        m_nativeData->m_ref--;
+        if (m_nativeData->m_ref == 0) 
+            delete m_nativeData;
+    }
     // Set Ref new one
     m_nativeData = data.GetNativeData();
     m_nativeData->m_ref++;
@@ -258,7 +262,9 @@ bool wxPrintData::Ok() const
     return m_nativeData->Ok();
 }
 
-#if WXWIN_COMPATIBILITY_2_4
+// What should happen here?  wxPostScriptPrintNativeData is not
+// defined unless all this is true on MSW.
+#if WXWIN_COMPATIBILITY_2_4 && wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
 
 #include "wx/generic/prntdlgg.h"