X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3c7fc996a73e9f6a83067bc28a3c5581a3fee65..4fe0156b18e2330be391b804da341e546164b85f:/src/mac/classic/dcprint.cpp diff --git a/src/mac/classic/dcprint.cpp b/src/mac/classic/dcprint.cpp index 03f81738af..c67228b4ff 100644 --- a/src/mac/classic/dcprint.cpp +++ b/src/mac/classic/dcprint.cpp @@ -398,6 +398,18 @@ void wxPrinterDC::EndPage(void) m_ok = m_nativePrinterDC->Ok() ; } +wxRect wxPrinterDC::GetPaperRect() +{ + wxMacCarbonPrintData *native = (wxMacCarbonPrintData*) m_printData.GetNativeData() ; + OSStatus err = noErr ; + PMRect rPaper; + err = PMGetAdjustedPaperRect(native->m_macPageFormat, &rPaper); + if ( err != noErr ) + return pageRect; + return wxRect(wxCoord(rPaper.left), wxCoord(rPaper.top), + wxCoord(rPaper.right - rPaper.left), wxCoord(rPaper.bottom - rPaper.top)); +} + void wxPrinterDC::DoGetSize(int *width, int *height) const { wxCHECK_RET( m_ok , _T("GetSize() doesn't work without a valid wxPrinterDC") );