X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/41514cc474a69b7ff554f1d5c529f079a30acfe7..eea4d01c65f9b29baa1193db762b4c6b8144af24:/src/msw/printwin.cpp?ds=sidebyside diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index dd8c25b420..9018f7de70 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -91,16 +91,10 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt return false; } - // Get some parameters from the printout, if defined - int fromPage, toPage; - int minPage, maxPage; - printout->GetPageInfo(&minPage, &maxPage, &fromPage, &toPage); - - m_printDialogData.SetFromPage(fromPage); - m_printDialogData.SetToPage(toPage); - m_printDialogData.SetMinPage(minPage); - m_printDialogData.SetMaxPage(maxPage); - m_printDialogData.SetAllPages((fromPage == minPage) && (toPage == maxPage)); + if (m_printDialogData.GetMinPage() < 1) + m_printDialogData.SetMinPage(1); + if (m_printDialogData.GetMaxPage() < 1) + m_printDialogData.SetMaxPage(9999); // Create a suitable device context wxPrinterDC *dc wxDUMMY_INITIALIZE(NULL); @@ -157,6 +151,11 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt 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;