]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/printwin.cpp
Fixed some bugs in up/down cursor navigation.
[wxWidgets.git] / src / msw / printwin.cpp
index 9018f7de7031374093ceeb7ce31959bd100d4023..dd8c25b4204c349e8416a4710aa5f74f8831ff2e 100644 (file)
@@ -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;