X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce00f59b5b169752d2f05ce3bb1a88ddc1b38b4c..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/osx/carbon/dcprint.cpp?ds=inline diff --git a/src/osx/carbon/dcprint.cpp b/src/osx/carbon/dcprint.cpp index 70dd928a39..e1927125bc 100644 --- a/src/osx/carbon/dcprint.cpp +++ b/src/osx/carbon/dcprint.cpp @@ -46,7 +46,7 @@ public : // returns 0 in case of no Error, otherwise platform specific error codes virtual wxUint32 GetStatus() const = 0 ; - bool Ok() { return GetStatus() == 0 ; } + bool IsOk() { return GetStatus() == 0 ; } static wxNativePrinterDC* Create(wxPrintData* data) ; } ; @@ -88,30 +88,17 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data ) m_err = PMSessionGetCurrentPrinter(native->GetPrintSession(), &printer); if ( m_err == noErr ) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - if ( PMPrinterGetOutputResolution != NULL ) + m_err = PMPrinterGetOutputResolution( printer, native->GetPrintSettings(), &res) ; + if ( m_err == -9589 /* kPMKeyNotFound */ ) { - { - m_err = PMPrinterGetOutputResolution( printer, native->GetPrintSettings(), &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 = PMPrinterGetPrinterResolution(printer, kPMCurrentValue, &res); - if ( m_err != noErr ) - { - m_err = PMGetResolution((PMPageFormat) (native->GetPageFormat()), &res); - } -#endif + m_err = noErr ; + res.hRes = res.vRes = 300; } } + else + { + res.hRes = res.vRes = 300; + } m_maxX = wxCoord((double)m_maxX * res.hRes / 72.0); m_maxY = wxCoord((double)m_maxY * res.vRes / 72.0); @@ -158,28 +145,14 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& message m_err = PMSessionGetCurrentPrinter(native->GetPrintSession(), &printer); if (m_err == noErr) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - if ( PMPrinterGetOutputResolution != NULL ) + m_err = PMPrinterGetOutputResolution( printer, native->GetPrintSettings(), &res) ; + if ( m_err == -9589 /* kPMKeyNotFound */ ) { - m_err = PMPrinterGetOutputResolution( printer, native->GetPrintSettings(), &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 - if ( PMPrinterGetPrinterResolution(printer, kPMCurrentValue, &res) != noErr ) - { - res.hRes = res.vRes = 300; - } -#endif + m_err = noErr ; + res.hRes = res.vRes = 300; } } - + m_maxX = wxCoord((double)m_maxX * res.hRes / 72.0); m_maxY = wxCoord((double)m_maxY * res.vRes / 72.0); @@ -288,7 +261,7 @@ wxPrinterDCImpl::wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& printda m_nativePrinterDC = wxNativePrinterDC::Create( &m_printData ) ; if ( m_nativePrinterDC ) { - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; if ( !m_ok ) { wxString message ; @@ -329,7 +302,7 @@ bool wxPrinterDCImpl::StartDoc( const wxString& message ) { // in case we have to do additional things when successful } - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; if ( !m_ok ) { wxString message ; @@ -347,7 +320,7 @@ void wxPrinterDCImpl::EndDoc(void) return ; m_nativePrinterDC->EndDoc( (wxPrinterDC*) GetOwner() ) ; - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; if ( !m_ok ) { @@ -397,7 +370,7 @@ void wxPrinterDCImpl::StartPage() m_backgroundBrush = *wxWHITE_BRUSH; m_nativePrinterDC->StartPage( (wxPrinterDC*) GetOwner() ) ; - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; } @@ -407,7 +380,7 @@ void wxPrinterDCImpl::EndPage() return ; m_nativePrinterDC->EndPage( (wxPrinterDC*) GetOwner() ); - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; } void wxPrinterDCImpl::DoGetSize(int *width, int *height) const