changing code that doesn't work on 10.5 as advertised
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
cfc65f264a
commit
c0f2dd1a54
@ -84,13 +84,30 @@ 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);
|
||||
PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ;
|
||||
#else
|
||||
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||
if ( PMPrinterGetOutputResolution != NULL )
|
||||
{
|
||||
PMPrinter printer;
|
||||
m_err = PMSessionGetCurrentPrinter(native->m_macPrintSession, &printer);
|
||||
if ( m_err == noErr )
|
||||
{
|
||||
m_err = PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ;
|
||||
if ( m_err == -9589 /* kPMKeyNotFound */ )
|
||||
{
|
||||
m_err = noErr ;
|
||||
res.hRes = res.vRes = 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
|
||||
m_err = PMGetResolution((PMPageFormat) (native->m_macPageFormat), &res);
|
||||
#endif
|
||||
}
|
||||
|
||||
m_ppi = wxSize(int(res.hRes), int(res.vRes));
|
||||
}
|
||||
|
||||
@ -132,7 +149,14 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& WXUNUSED
|
||||
PMPrinter printer;
|
||||
m_err = PMSessionGetCurrentPrinter(native->m_macPrintSession, &printer);
|
||||
if ( m_err == noErr )
|
||||
{
|
||||
m_err = PMPrinterGetOutputResolution( printer, native->m_macPrintSettings, &res) ;
|
||||
if ( m_err == -9589 /* kPMKeyNotFound */ )
|
||||
{
|
||||
m_err = noErr ;
|
||||
res.hRes = res.vRes = 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user