X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5276b0a53cef4815230e39b54d2ecda14f72cbd1..bf7470fe143838b3cc928edb5838e78f0670c539:/src/msw/printwin.cpp diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 5dba0607ba..dd8c25b420 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -49,8 +49,9 @@ #include "wx/msw/printdlg.h" #include "wx/msw/private.h" #include "wx/msw/dcprint.h" -#include "wx/msw/enhmeta.h" - +#if wxUSE_ENH_METAFILE + #include "wx/msw/enhmeta.h" +#endif #include // --------------------------------------------------------------------------- @@ -90,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); @@ -150,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; @@ -390,6 +392,7 @@ void wxWindowsPrintPreview::DetermineScaling() m_previewScaleY = float(logPPIScreenY) / logPPIPrinterY; } +#if wxUSE_ENH_METAFILE bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum) { // The preview, as implemented in wxPrintPreviewBase (and as used prior to @@ -435,7 +438,7 @@ bool wxWindowsPrintPreview::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum) return true; } - +#endif // wxUSE_ENH_METAFILE BOOL CALLBACK wxAbortProc(HDC WXUNUSED(hdc), int WXUNUSED(error)) {