Add wxPrintout::SetUp() to reuse the same code in all ports
MSW, GTK, OSX and Postscript implementations all did almost exactly the same thing to initialize wxPrintout, so extract this common code into a new wxPrintout method and just call it instead. There should be no changes in behaviour.
This commit is contained in:
@@ -1024,19 +1024,8 @@ void wxGtkPrinter::BeginPrint(wxPrintout *printout, GtkPrintOperation *operation
|
||||
return;
|
||||
}
|
||||
|
||||
printout->SetPPIScreen(wxGetDisplayPPI());
|
||||
printout->SetPPIPrinter( printDC->GetResolution(),
|
||||
printDC->GetResolution() );
|
||||
printout->SetUp(*m_dc);
|
||||
|
||||
printout->SetDC(m_dc);
|
||||
|
||||
int w, h;
|
||||
m_dc->GetSize(&w, &h);
|
||||
printout->SetPageSizePixels((int)w, (int)h);
|
||||
printout->SetPaperRectPixels(wxRect(0, 0, w, h));
|
||||
int mw, mh;
|
||||
m_dc->GetSizeMM(&mw, &mh);
|
||||
printout->SetPageSizeMM((int)mw, (int)mh);
|
||||
printout->OnPreparePrinting();
|
||||
|
||||
// Get some parameters from the printout, if defined.
|
||||
|
Reference in New Issue
Block a user