moving GetPageInfo to later stage, closes #11494
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -553,22 +553,13 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
sm_abortWindow = NULL;
|
sm_abortWindow = NULL;
|
||||||
|
|
||||||
if (!printout)
|
if (!printout)
|
||||||
|
{
|
||||||
|
sm_lastError = wxPRINTER_ERROR;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
printout->SetIsPreview(false);
|
printout->SetIsPreview(false);
|
||||||
|
|
||||||
// Get some parameters from the printout, if defined
|
|
||||||
int fromPage, toPage;
|
|
||||||
int minPage, maxPage;
|
|
||||||
printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage);
|
|
||||||
|
|
||||||
if (maxPage == 0) return false;
|
|
||||||
|
|
||||||
// Only set min and max, because from and to will be
|
|
||||||
// set by the user
|
|
||||||
m_printDialogData.SetMinPage(minPage);
|
|
||||||
m_printDialogData.SetMaxPage(maxPage);
|
|
||||||
|
|
||||||
if (m_printDialogData.GetMinPage() < 1)
|
if (m_printDialogData.GetMinPage() < 1)
|
||||||
m_printDialogData.SetMinPage(1);
|
m_printDialogData.SetMinPage(1);
|
||||||
if (m_printDialogData.GetMaxPage() < 1)
|
if (m_printDialogData.GetMaxPage() < 1)
|
||||||
@@ -642,6 +633,22 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
|||||||
|
|
||||||
printout->OnPreparePrinting();
|
printout->OnPreparePrinting();
|
||||||
|
|
||||||
|
// Get some parameters from the printout, if defined
|
||||||
|
int fromPage, toPage;
|
||||||
|
int minPage, maxPage;
|
||||||
|
printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage);
|
||||||
|
|
||||||
|
if (maxPage == 0)
|
||||||
|
{
|
||||||
|
sm_lastError = wxPRINTER_ERROR;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only set min and max, because from and to will be
|
||||||
|
// set by the user
|
||||||
|
m_printDialogData.SetMinPage(minPage);
|
||||||
|
m_printDialogData.SetMaxPage(maxPage);
|
||||||
|
|
||||||
printout->OnBeginPrinting();
|
printout->OnBeginPrinting();
|
||||||
|
|
||||||
bool keepGoing = true;
|
bool keepGoing = true;
|
||||||
|
Reference in New Issue
Block a user