X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/161f4f7380e945b0769ad5f7122df55b8777396a..4d90b8de01ca34d4d123d6d2386968bfe4923efc:/src/common/prntbase.cpp diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index bbbcefc57d..4521ba7b8f 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -183,7 +183,7 @@ wxPreviewCanvas::wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent, wxScrolledWindow(parent, -1, pos, size, style, name) { m_printPreview = preview; - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); SetScrollbars(15, 18, 100, 100); } @@ -213,7 +213,7 @@ void wxPreviewCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) // Responds to colour changes, and passes event on to children. void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event) { - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); Refresh(); // Propagate the event to the non-top-level children @@ -612,7 +612,8 @@ bool wxPrintPreviewBase::SetCurrentPage(int pageNum) if (m_previewCanvas) { - RenderPage(pageNum); + if (!RenderPage(pageNum)) + return FALSE; m_previewCanvas->Refresh(); } return TRUE; @@ -623,7 +624,8 @@ bool wxPrintPreviewBase::PaintPage(wxWindow *canvas, wxDC& dc) DrawBlankPage(canvas, dc); if (!m_previewBitmap) - RenderPage(m_currentPage); + if (!RenderPage(m_currentPage)) + return FALSE; if (!m_previewBitmap) return FALSE; @@ -682,8 +684,10 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) m_previewBitmap = new wxBitmap((int)actualWidth, (int)actualHeight); if (!m_previewBitmap || !m_previewBitmap->Ok()) { - if (m_previewBitmap) + if (m_previewBitmap) { delete m_previewBitmap; + m_previewBitmap = NULL; + } wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK); return FALSE; } @@ -713,6 +717,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) memoryDC.SelectObject(wxNullBitmap); delete m_previewBitmap; + m_previewBitmap = NULL; return FALSE; }