Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#11494 closed defect (fixed)

FIX: GetPageInfo being called incorrectly on OSX

Reported by: SnowLeopard Owned by: csomor
Priority: normal Milestone:
Component: wxOSX-Cocoa Version: stable-latest
Keywords: OSX Printing Cc:
Blocked By: Blocking:
Patch: yes

Description

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.

Attachments (2)

update.diff download (1.4 KB) - added by SnowLeopard 4 years ago.
patch file
wxOSX_print.patch download (2.2 KB) - added by Auria 3 years ago.
An updated version that applies cleanly on newer revisions of trunk

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by SnowLeopard

patch file

comment:1 Changed 4 years ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

comment:2 Changed 4 years ago by SC

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [63182]) moving GetPageInfo to later stage, closes #11494

Changed 3 years ago by Auria

An updated version that applies cleanly on newer revisions of trunk

comment:3 Changed 3 years ago by Auria

Sorry for the noise, I accidentally uploaded a patch to the wrong ticket =( please ignore

Note: See TracTickets for help on using tickets.