X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/962cbf2ee0ba655db3e6db00ade68b5f1e85ba1e..867e99f57d01aaf89e5b470a2db97c95a0ac621f:/src/mac/carbon/printdlg.cpp?ds=sidebyside diff --git a/src/mac/carbon/printdlg.cpp b/src/mac/carbon/printdlg.cpp index 5fd25c56da..ec13b97455 100644 --- a/src/mac/carbon/printdlg.cpp +++ b/src/mac/carbon/printdlg.cpp @@ -18,6 +18,16 @@ #include "wx/dcprint.h" #include "wx/msgdlg.h" #include "wx/mac/uma.h" +#ifndef __DARWIN__ + #include "Printing.h" +#endif + +#if defined(TARGET_CARBON) && !defined(__DARWIN__) +# if PM_USE_SESSION_APIS +# include +# endif +# include +#endif // Use generic page setup dialog: use your own native one if one exists. @@ -61,8 +71,10 @@ bool wxPrintDialog::Create(wxWindow *p, wxPrintDialogData* data) wxPrintDialog::~wxPrintDialog() { - if (m_destroyDC && m_printerDC) + if (m_destroyDC && m_printerDC) { delete m_printerDC; + m_printerDC = NULL; + } } int wxPrintDialog::ShowModal() @@ -72,11 +84,11 @@ int wxPrintDialog::ShowModal() wxString message ; #if !TARGET_CARBON - err = ::UMAPrOpen() ; + err = ::UMAPrOpen(NULL) ; if ( err == noErr ) { m_printDialogData.ConvertToNative() ; - if ( ::PrJobDialog( (THPrint) m_printDialogData.GetPrintData().m_macPrintInfo ) ) + if ( ::PrJobDialog( (THPrint) m_printDialogData.GetPrintData().m_macPrintSettings ) ) { m_printDialogData.ConvertFromNative() ; result = wxID_OK ; @@ -89,7 +101,7 @@ int wxPrintDialog::ShowModal() wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); } - ::UMAPrClose() ; + ::UMAPrClose(NULL) ; #else #if PM_USE_SESSION_APIS PMPrintSession macPrintSession = kPMNoReference; @@ -224,11 +236,11 @@ int wxPageSetupDialog::ShowModal() wxString message ; #if !TARGET_CARBON - err = ::UMAPrOpen() ; + err = ::UMAPrOpen(NULL) ; if ( err == noErr ) { m_pageSetupData.ConvertToNative() ; - if ( ::PrStlDialog( (THPrint) m_pageSetupData.GetPrintData().m_macPrintInfo ) ) + if ( ::PrStlDialog( (THPrint) m_pageSetupData.GetPrintData().m_macPrintSettings ) ) { m_pageSetupData.ConvertFromNative() ; result = wxID_OK ; @@ -241,7 +253,7 @@ int wxPageSetupDialog::ShowModal() wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; dialog.ShowModal(); } - ::UMAPrClose() ; + ::UMAPrClose(NULL) ; #else #if PM_USE_SESSION_APIS PMPrintSession macPrintSession = kPMNoReference;