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:
Vadim Zeitlin
2018-05-23 17:52:31 +02:00
parent b6f0693a41
commit 048b7f44ec
6 changed files with 37 additions and 65 deletions

View File

@@ -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.