X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c929ad91417a4ee797652d79300c0c23219a46fd..343ef639a9c054e4d1883156b38a6b02fd629fd7:/src/msw/printwin.cpp diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 9018f7de70..dd8c25b420 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -91,10 +91,16 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt return false; } - if (m_printDialogData.GetMinPage() < 1) - m_printDialogData.SetMinPage(1); - if (m_printDialogData.GetMaxPage() < 1) - m_printDialogData.SetMaxPage(9999); + // 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)); // Create a suitable device context wxPrinterDC *dc wxDUMMY_INITIALIZE(NULL); @@ -151,11 +157,6 @@ 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;