removing Leopard only code that doesn't mix well with the existing Printing Manager, fixes #10343

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@57932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-01-09 10:01:11 +00:00
parent 6360b8b1a0
commit 4d371eebfc
2 changed files with 4 additions and 29 deletions

View File

@@ -89,14 +89,7 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data )
m_maxY = wxCoord(rPage.bottom - rPage.top);
PMResolution res;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
PMPrinter printer;
PMSessionGetCurrentPrinter(native->m_macPrintSession, &printer);
m_err = PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ;
if ( m_err )
// fallback to the old API if there was an error
#endif
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
m_ppi = wxSize(int(res.hRes), int(res.vRes));
}
@@ -152,14 +145,7 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED
m_maxY = wxCoord(rPage.bottom - rPage.top);
PMResolution res;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
PMPrinter printer;
PMSessionGetCurrentPrinter(native->m_macPrintSession, &printer);
m_err = PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ;
if ( m_err )
// fallback to the old API if there was an error
#endif
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
m_ppi = wxSize(int(res.hRes), int(res.vRes));
return true ;

View File

@@ -180,15 +180,10 @@ bool wxMacCarbonPrintData::TransferFrom( const wxPrintData &data )
PMResolution res;
PMPrinter printer;
PMSessionGetCurrentPrinter(m_macPrintSession, &printer);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
PMPrinterGetOutputResolution( printer,
(PMPrintSettings) m_macPrintSettings, &res) ;
// TODO transfer ? into page format ?
#else
PMTag tag = kPMMaxSquareResolution;
PMPrinterGetPrinterResolution(printer, tag, &res);
PMSetResolution((PMPageFormat) m_macPageFormat, &res);
#endif
// after setting the new resolution the format has to be updated, otherwise the page rect remains
// at the 'old' scaling
PMSessionValidatePageFormat((PMPrintSession) m_macPrintSession,
@@ -345,7 +340,7 @@ void wxMacCarbonPrintData::TransferTo( wxPrintDialogData* data )
data->SetAllPages( true ) ;
// This means all pages, more or less
data->SetFromPage(1);
data->SetToPage(32000);
data->SetToPage(9999);
}
else
{
@@ -424,13 +419,7 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
PMResolution res;
wxMacCarbonPrintData* nativeData = (wxMacCarbonPrintData*)
(m_printDialogData.GetPrintData().GetNativeData());
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
PMPrinter printer;
PMSessionGetCurrentPrinter(nativeData->m_macPrintSession, &printer);
PMPrinterGetOutputResolution( printer, nativeData->m_macPrintSettings, &res) ;
#else
PMGetResolution((PMPageFormat) (nativeData->m_macPageFormat), &res);
#endif
printout->SetPPIPrinter(int(res.hRes), int(res.vRes));
// Set printout parameters