X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72259e00633be1e01a10cb4d6eba33f8a5fca228..3838e2d36ee9320b6d432b9a7aa75a8092024daa:/src/common/cmndata.cpp diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 39e55667e6..c2208533aa 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -49,7 +49,7 @@ #include "wx/paper.h" #endif // wxUSE_PRINTING_ARCHITECTURE -#if defined(__WXMSW__) && !defined(__PALMOS__) +#if defined(__WXMSW__) && !defined(__WXPALMOS__) #include #include "wx/msw/private.h" @@ -190,15 +190,16 @@ wxPrintData::wxPrintData() wxPrintData::wxPrintData(const wxPrintData& printData) : wxObject() { + m_nativeData = NULL; (*this) = printData; } wxPrintData::~wxPrintData() { m_nativeData->m_ref--; - if (m_nativeData->m_ref == 0) + if (m_nativeData->m_ref == 0) delete m_nativeData; - + #ifdef __WXMAC__ delete m_nativePrintData ; #endif @@ -235,16 +236,19 @@ void wxPrintData::operator=(const wxPrintData& data) m_paperSize = data.m_paperSize; m_bin = data.m_bin; m_printMode = data.m_printMode; - m_filename = data.m_filename; + 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++; - + #ifdef __WXMAC__ m_nativePrintData->CopyFrom( data.m_nativePrintData ) ; #endif @@ -440,10 +444,10 @@ wxPrintDialogData::wxPrintDialogData() m_printSelection = false; m_printEnableSelection = false; m_printEnablePageNumbers = true; - + wxPrintFactory* factory = wxPrintFactory::GetFactory(); m_printEnablePrintToFile = ! factory->HasOwnPrintToFile(); - + m_printEnableHelp = false; #if WXWIN_COMPATIBILITY_2_4 m_printSetupDialog = false;