X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/166fbaa46a1b3583832b84ef88c311e0f7557c5b..58cccb3b449cff705230aadb936c891b7fa6fd28:/src/common/cmndata.cpp diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index a9a9c05f8e..2fd075f47e 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -92,7 +92,7 @@ void wxColourData::SetCustomColour(int i, const wxColour& colour) m_custColours[i] = colour; } -wxColour wxColourData::GetCustomColour(int i) +wxColour wxColourData::GetCustomColour(int i) const { wxCHECK_MSG( i >= 0 && i < NUM_CUSTOM, wxColour(0,0,0), _T("custom colour index out of range") ); @@ -256,8 +256,11 @@ void wxPrintData::ConvertFromNative() m_nativeData->TransferTo( *this ) ; } -void wxPrintData::operator=(const wxPrintData& data) +wxPrintData& wxPrintData::operator=(const wxPrintData& data) { + if ( &data == this ) + return *this; + m_printNoCopies = data.m_printNoCopies; m_printCollate = data.m_printCollate; m_printOrientation = data.m_printOrientation; @@ -295,6 +298,8 @@ void wxPrintData::operator=(const wxPrintData& data) m_privData = new char[m_privDataLen]; memcpy( m_privData, data.GetPrivData(), m_privDataLen ); } + + return *this; } // Is this data OK for showing the print dialog? @@ -342,7 +347,12 @@ wxPrintDialogData::wxPrintDialogData(const wxPrintData& printData) m_printMinPage = 1; m_printMaxPage = 9999; m_printNoCopies = 1; + // On Mac the Print dialog always defaults to "All Pages" +#ifdef __WXMAC__ + m_printAllPages = true; +#else m_printAllPages = false; +#endif m_printCollate = false; m_printToFile = false; m_printSelection = false; @@ -494,7 +504,7 @@ void wxPageSetupDialogData::SetPrintData(const wxPrintData& printData) // paper id void wxPageSetupDialogData::CalculateIdFromPaperSize() { - wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), + wxASSERT_MSG( (wxThePrintPaperDatabase != NULL), wxT("wxThePrintPaperDatabase should not be NULL. Do not create global print dialog data objects.") ); wxSize sz = GetPaperSize(); @@ -509,7 +519,7 @@ void wxPageSetupDialogData::CalculateIdFromPaperSize() // Use paper id in wxPrintData to set this object's paper size void wxPageSetupDialogData::CalculatePaperSizeFromId() { - wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), + wxASSERT_MSG( (wxThePrintPaperDatabase != NULL), wxT("wxThePrintPaperDatabase should not be NULL. Do not create global print dialog data objects.") ); wxSize sz = wxThePrintPaperDatabase->GetSize(m_printData.GetPaperId());