Ticket #11494 (closed defect: fixed)
FIX: GetPageInfo being called incorrectly on OSX
|Reported by:||SnowLeopard||Owned by:||csomor|
According to the documentation for wxPrintout::OnPreparePrinting:
Called once by the framework before any other demands are made of the wxPrintout object.
This gives the object an opportunity to calculate the number of pages in the document, for example.
On Windows this holds true, but on OSX (in wxMacPrinter::Print) wxPrintout::GetPageInfo is called *before* OnPreparePrinting. This contradicts the documentation and makes it so that if your printout object calculates the page range in OnPreparePrinting (as the documentation recommends), then the print operation will either fail or have unexpected behavior.
Attached patch moves the call to GetPageInfo *after* OnPreparePrinting is called (just like the similar Print function in "printwin.cpp"). Works fine with my custom printout object now.