X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5d5c59e9c43193234510f847df1dc139477990c6..a4f4d548ce0d3533fe9e84d812643cc7c21dd580:/src/mac/carbon/printmac.cpp?ds=sidebyside diff --git a/src/mac/carbon/printmac.cpp b/src/mac/carbon/printmac.cpp index 859b67e79d..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" @@ -262,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 ) @@ -272,14 +279,13 @@ void wxMacCarbonPrintData::TransferFrom( wxPrintDialogData* data ) PMSetCopies( m_macPrintSettings , data->GetNoCopies() , false ) ; PMSetFirstPage( m_macPrintSettings , data->GetFromPage() , false ) ; - int toPage = data->GetToPage(); - if (toPage < 1) + if (data->GetAllPages() || data->GetFromPage() == 0) { - PMSetLastPage( m_macPrintSettings , kPMPrintAllPages, true ) ; + PMSetLastPage( m_macPrintSettings , (UInt32) kPMPrintAllPages, true ) ; } else { - PMSetLastPage( m_macPrintSettings , toPage , false ) ; + PMSetLastPage( m_macPrintSettings , (UInt32) data->GetToPage() , false ) ; } } @@ -543,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