X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83666e99093aa0b65c497f7e6c75d98a875667cc..29a35dd5fee0e33143a39824e71aefd66e3e4851:/src/common/cmndata.cpp diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 4a02c49298..d8cc2b03a8 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -87,7 +87,7 @@ wxColourData::~wxColourData() void wxColourData::SetCustomColour(int i, const wxColour& colour) { - wxCHECK_RET( i >= 0 && i < NUM_CUSTOM, _T("custom colour index out of range") ); + wxCHECK_RET( i >= 0 && i < NUM_CUSTOM, wxT("custom colour index out of range") ); m_custColours[i] = colour; } @@ -95,7 +95,7 @@ void wxColourData::SetCustomColour(int i, const wxColour& colour) wxColour wxColourData::GetCustomColour(int i) const { wxCHECK_MSG( i >= 0 && i < NUM_CUSTOM, wxColour(0,0,0), - _T("custom colour index out of range") ); + wxT("custom colour index out of range") ); return m_custColours[i]; } @@ -504,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(); @@ -519,14 +519,17 @@ 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()); - // sz is in 10ths of a mm, while paper size is in mm - m_paperSize.x = sz.x / 10; - m_paperSize.y = sz.y / 10; + if (sz != wxSize(0, 0)) + { + // sz is in 10ths of a mm, while paper size is in mm + m_paperSize.x = sz.x / 10; + m_paperSize.y = sz.y / 10; + } } #endif // wxUSE_PRINTING_ARCHITECTURE