projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
corrected blind fix of missing .c_str()s
[wxWidgets.git]
/
src
/
common
/
prntbase.cpp
diff --git
a/src/common/prntbase.cpp
b/src/common/prntbase.cpp
index bbbcefc57dc87ceced9fcc4bdfaaa47b5a3cb417..8e7e80b76929dc40fe1778d31c59e0a66ed059e4 100644
(file)
--- a/
src/common/prntbase.cpp
+++ b/
src/common/prntbase.cpp
@@
-612,7
+612,8
@@
bool wxPrintPreviewBase::SetCurrentPage(int pageNum)
if (m_previewCanvas)
{
if (m_previewCanvas)
{
- RenderPage(pageNum);
+ if (!RenderPage(pageNum))
+ return FALSE;
m_previewCanvas->Refresh();
}
return TRUE;
m_previewCanvas->Refresh();
}
return TRUE;
@@
-623,7
+624,8
@@
bool wxPrintPreviewBase::PaintPage(wxWindow *canvas, wxDC& dc)
DrawBlankPage(canvas, dc);
if (!m_previewBitmap)
DrawBlankPage(canvas, dc);
if (!m_previewBitmap)
- RenderPage(m_currentPage);
+ if (!RenderPage(m_currentPage))
+ return FALSE;
if (!m_previewBitmap)
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())
{
m_previewBitmap = new wxBitmap((int)actualWidth, (int)actualHeight);
if (!m_previewBitmap || !m_previewBitmap->Ok())
{
- if (m_previewBitmap)
+ if (m_previewBitmap)
{
delete m_previewBitmap;
delete m_previewBitmap;
+ m_previewBitmap = NULL;
+ }
wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK);
return FALSE;
}
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;
memoryDC.SelectObject(wxNullBitmap);
delete m_previewBitmap;
+ m_previewBitmap = NULL;
return FALSE;
}
return FALSE;
}