]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dcprint.cpp
Make wxPASSWORD and wxPROCESS_ENTER really deprecated.
[wxWidgets.git] / src / mac / carbon / dcprint.cpp
index 3e23605ef79af14c07c187a3e1d64a84007f165b..a7d3de26e9011b37e55b6a2a0af756d9bea969a3 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:       wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "dcprint.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -180,8 +176,11 @@ void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc )
         if ( !m_err )
         {
 #if wxMAC_USE_CORE_GRAPHICS
-            CGContextTranslateCTM( pageContext , 0 , rPage.bottom - rPage.top ) ;
+            PMRect paperRect ;
+            PMGetAdjustedPaperRect( native->m_macPageFormat , &paperRect ) ;
+            CGContextTranslateCTM( pageContext , -paperRect.left , -paperRect.top + ( rPage.bottom - rPage.top ) ) ;
             CGContextScaleCTM( pageContext , 1 , -1 ) ;
+            CGContextSaveGState( pageContext ) ;
 #else
             dc->m_macLocalOrigin.x = (int) rPage.left;
             dc->m_macLocalOrigin.y = (int) rPage.top;
@@ -231,6 +230,10 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
 
 wxPrinterDC::~wxPrinterDC(void)
 {
+#if wxMAC_USE_CORE_GRAPHICS
+    // this context was borrowed
+    ((wxMacCGContext*)(m_graphicContext))->SetNativeContext( NULL ) ;
+#endif
     delete m_nativePrinterDC ;
 }