X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc7ccb9c5dcc8d68157dcc2c7cd2da230d45916d..bc88602a653c5ac9c7a3307d6f52a7ae0e572b41:/src/mac/carbon/printmac.cpp diff --git a/src/mac/carbon/printmac.cpp b/src/mac/carbon/printmac.cpp index e2c5e5bcf8..f6ad66c279 100644 --- a/src/mac/carbon/printmac.cpp +++ b/src/mac/carbon/printmac.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "printwin.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -41,11 +37,9 @@ #include -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxMacCarbonPrintData, wxPrintNativeDataBase) IMPLEMENT_DYNAMIC_CLASS(wxMacPrinter, wxPrinterBase) IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase) -#endif bool wxMacCarbonPrintData::Ok() const { @@ -264,8 +258,19 @@ void wxMacCarbonPrintData::TransferTo( wxPrintDialogData* data ) UInt32 from , to ; PMGetFirstPage( m_macPrintSettings , &from ) ; PMGetLastPage( m_macPrintSettings , &to ) ; - data->SetFromPage( from ) ; - data->SetToPage( to ) ; + if ( to >= 0x7FFFFFFF ) // due to an OS Bug we don't get back kPMPrintAllPages + { + data->SetAllPages( true ) ; + // This means all pages, more or less + data->SetFromPage(1); + data->SetToPage(32000); + } + else + { + data->SetFromPage( from ) ; + data->SetToPage( to ) ; + data->SetAllPages( false ); + } } void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data ) @@ -274,10 +279,14 @@ void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data ) PMSetCopies( m_macPrintSettings , data->GetNoCopies() , false ) ; PMSetFirstPage( m_macPrintSettings , data->GetFromPage() , false ) ; - int toPage = data->GetToPage(); - if (toPage < 1) - toPage = data->GetFromPage(); - PMSetLastPage( m_macPrintSettings , toPage , false ) ; + if (data->GetAllPages() || data->GetFromPage() == 0) + { + PMSetLastPage( m_macPrintSettings , (UInt32) kPMPrintAllPages, true ) ; + } + else + { + PMSetLastPage( m_macPrintSettings , (UInt32) data->GetToPage() , false ) ; + } } /* @@ -540,7 +549,7 @@ void wxMacPrintPreview::DetermineScaling(void) // m_previewScale = (float)((float)screenWidth/(float)printerWidth); // m_previewScale = m_previewScale * (float)((float)screenXRes/(float)printerXRes); - m_previewScale = 1 ; + m_previewScale = 1 ; } #endif