X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc0cea5e0e044f13b2168587242a10022c2ac7e9..fad92e2f367f5c37ba4d80c9b57a4453e86c6ac2:/src/common/cmndata.cpp?ds=sidebyside diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 3c04d1d0b9..4a02c49298 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?