X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7aa9bb7c0381c735cecba13abc7cb2b3c077c66..e733c4ce1e24cf7e4b0b0d8362fc59aaa7a7641c:/src/msw/printwin.cpp diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 0c8a2ed652..6929bbfe39 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -196,7 +195,14 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt maxPageNum = m_printDialogData.GetToPage(); } - const int maxCopyCount = m_printDialogData.GetNoCopies(); + // The dc we get from the PrintDialog will do multiple copies without help + // if the device supports it. Loop only if we have created a dc from our + // own m_printDialogData or the device does not support multiple copies. + // m_printDialogData.GetPrintData().GetNoCopies() is set from device + // devMode in printdlg.cpp/wxWindowsPrintDialog::ConvertFromNative() + const int maxCopyCount = !prompt || + !m_printDialogData.GetPrintData().GetNoCopies() + ? m_printDialogData.GetNoCopies() : 1; for ( int copyCount = 1; copyCount <= maxCopyCount; copyCount++ ) { if ( !printout->OnBeginDocument(minPageNum, maxPageNum) )