Revert "Fix the pages range in the print dialog in wxOSX."
This reverts r72805 (leaving only the changes to printdlg.cpp which seem harmless and potentially useful) as it resulted in crashes when using wxHtmlEasyPrinting because we called wxPrintout::OnPreparePrinting() before setting the DC to be used, which was wrong. In fact it's not clear how can we get the correct range of pages at all because we need a DC to paginate properly (i.e. taking into account its size) but we need to show a dialog, in which we already want to show the pages range, before choosing the DC. Perhaps we could create a dummy DC for pagination purposes but how could this work with printers using different page sizes? The best would probably be to avoid setting any limits on the page range as showing 9999 looks ugly but anything else would be wrong. See #8349, #11779. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -604,7 +604,6 @@ wxMSW:
|
||||
|
||||
wxOSX/Cocoa:
|
||||
|
||||
- Fix pages range in the print dialog (Auria).
|
||||
- Implement image support in wxNotebook (Malcolm MacLeod).
|
||||
- Add support for button mnemonics (joostn).
|
||||
|
||||
|
@@ -549,24 +549,6 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only set min and max, because from and to will be
|
||||
// set by the user
|
||||
m_printDialogData.SetMinPage(minPage);
|
||||
m_printDialogData.SetMaxPage(maxPage);
|
||||
|
||||
if (m_printDialogData.GetMinPage() < 1)
|
||||
m_printDialogData.SetMinPage(1);
|
||||
if (m_printDialogData.GetMaxPage() < 1)
|
||||
@@ -629,8 +611,27 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
||||
dc->GetSizeMM(&mw, &mh);
|
||||
printout->SetPageSizeMM((int)mw, (int)mh);
|
||||
|
||||
// Create an abort window
|
||||
wxBeginBusyCursor();
|
||||
|
||||
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;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only set min and max, because from and to will be
|
||||
// set by the user
|
||||
m_printDialogData.SetMinPage(minPage);
|
||||
m_printDialogData.SetMaxPage(maxPage);
|
||||
|
||||
printout->OnBeginPrinting();
|
||||
|
||||
bool keepGoing = true;
|
||||
|
Reference in New Issue
Block a user