Fix printing multiple copies in wxMSW.
If wxPrinterDC was created by the native "Print" dialog for a printer that supports printing multiple copies, we must not manually print multiple copies ourselves as this results in too many copies being printed. However we still need to loop explicitly for wxPrinterDC objects created manually or for the printers without support for multiple copies (supposing they still exist). Closes #10323. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -697,6 +697,7 @@ wxMSW:
|
||||
- Return more native shell icons from wxArtProvider (Markus Juergens).
|
||||
- Fix filter checks in wxDir::FindFirst/Next() (Catalin Raceanu).
|
||||
- Add support for wxICON_AUTH_NEEDED to wxMessageDialog (Chris Spencer).
|
||||
- Fix printing too many copies of the document in some cases (John Roberts).
|
||||
|
||||
wxOSX/Cocoa:
|
||||
|
||||
|
@@ -196,7 +196,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) )
|
||||
|
Reference in New Issue
Block a user