X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/246c5004eb5a1d6bd592cbc0981cf6c3e10895de..c7c6e54baed01937426239dd38164ee0326fa172:/src/mac/classic/dcprint.cpp diff --git a/src/mac/classic/dcprint.cpp b/src/mac/classic/dcprint.cpp index fb7d386862..c67228b4ff 100644 --- a/src/mac/classic/dcprint.cpp +++ b/src/mac/classic/dcprint.cpp @@ -20,9 +20,9 @@ #ifndef WX_PRECOMP #include "wx/msgdlg.h" + #include "wx/math.h" #endif -#include "wx/math.h" #include "wx/mac/uma.h" #include "wx/mac/private/print.h" @@ -52,7 +52,7 @@ class wxMacCarbonPrinterDC : public wxNativePrinterDC { public : wxMacCarbonPrinterDC( wxPrintData* data ) ; - ~wxMacCarbonPrinterDC() ; + virtual ~wxMacCarbonPrinterDC() ; virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) ; virtual void EndDoc( wxPrinterDC* dc ) ; virtual void StartPage( wxPrinterDC* dc ) ; @@ -185,7 +185,7 @@ class wxMacClassicPrinterDC : public wxNativePrinterDC { public : wxMacClassicPrinterDC( wxPrintData* data ) ; - ~wxMacClassicPrinterDC() ; + virtual ~wxMacClassicPrinterDC() ; virtual bool StartDoc( wxPrinterDC* dc , const wxString& message ) ; virtual void EndDoc( wxPrinterDC* dc ) ; virtual void StartPage( wxPrinterDC* dc ) ; @@ -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") );