Refactor return code in wxGtkPrinter::Print()
No real changes, just make it simpler to do other things before returning successfully by handling error returns separately. This is also more consistent with PrintDialog() method of the same class. No real changes.
This commit is contained in:
@@ -977,19 +977,23 @@ bool wxGtkPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt )
|
||||
|
||||
// doesn't necessarily show
|
||||
int ret = dialog.ShowModal();
|
||||
if (ret == wxID_CANCEL)
|
||||
{
|
||||
sm_lastError = wxPRINTER_CANCELLED;
|
||||
}
|
||||
if (ret == wxID_NO)
|
||||
{
|
||||
sm_lastError = wxPRINTER_ERROR;
|
||||
}
|
||||
|
||||
printout->SetDC(NULL);
|
||||
wxDELETE(m_dc);
|
||||
|
||||
return (sm_lastError == wxPRINTER_NO_ERROR);
|
||||
if (ret == wxID_CANCEL)
|
||||
{
|
||||
sm_lastError = wxPRINTER_CANCELLED;
|
||||
return false;
|
||||
}
|
||||
if (ret == wxID_NO)
|
||||
{
|
||||
sm_lastError = wxPRINTER_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
||||
sm_lastError = wxPRINTER_NO_ERROR;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxGtkPrinter::BeginPrint(wxPrintout *printout, GtkPrintOperation *operation, GtkPrintContext *context)
|
||||
|
Reference in New Issue
Block a user