]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/printwin.cpp
generic/wizard.h added
[wxWidgets.git] / src / msw / printwin.cpp
index 0f05f726185ca818f3926fa2b8f207af0027acaa..c9ee2c73687edf4c277e39f341cebd1fea88cc41 100644 (file)
@@ -231,10 +231,10 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt
 
     printout->OnBeginPrinting();
 
-    bool keepGoing = TRUE;
-
     int copyCount;
-    for (copyCount = 1; copyCount <= m_printDialogData.GetNoCopies(); copyCount ++)
+    for ( copyCount = 1;
+          copyCount <= m_printDialogData.GetNoCopies();
+          copyCount++ )
     {
         if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage()))
         {
@@ -246,21 +246,23 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt
             break;
 
         int pn;
-        for (pn = m_printDialogData.GetFromPage(); keepGoing && (pn <= m_printDialogData.GetToPage()) && printout->HasPage(pn);
-        pn++)
+        for ( pn = m_printDialogData.GetFromPage();
+              pn <= m_printDialogData.GetToPage() && printout->HasPage(pn);
+              pn++ )
         {
-            if (sm_abortIt)
+            if ( sm_abortIt )
             {
-                keepGoing = FALSE;
                 break;
             }
-            else
-            {
-                dc->StartPage();
-                printout->OnPrintPage(pn);
-                dc->EndPage();
-            }
+
+            dc->StartPage();
+            bool cont = printout->OnPrintPage(pn);
+            dc->EndPage();
+
+            if ( !cont )
+                break;
         }
+
         printout->OnEndDocument();
     }