Fix the pages range in the print dialog in wxOSX.
Set the min/max pages earlier for them to be taken into account and also actually do set them in the print settings. Closes #8349. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -549,6 +549,24 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
||||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (m_printDialogData.GetMinPage() < 1)
|
||||
m_printDialogData.SetMinPage(1);
|
||||
if (m_printDialogData.GetMaxPage() < 1)
|
||||
@@ -611,27 +629,8 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
||||
dc->GetSizeMM(&mw, &mh);
|
||||
printout->SetPageSizeMM((int)mw, (int)mh);
|
||||
|
||||
// Create an abort window
|
||||
wxBeginBusyCursor();
|
||||
|
||||
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();
|
||||
|
||||
bool keepGoing = true;
|
||||
|
||||
Reference in New Issue
Block a user