From 4b77e661be4fb3ee713344522355b3d82dc6acc1 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 19 May 2010 07:24:16 +0000 Subject: [PATCH] set default resolutions in case of errors git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/dcprint.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osx/carbon/dcprint.cpp b/src/osx/carbon/dcprint.cpp index 3c400a2aba..51cd175ff1 100644 --- a/src/osx/carbon/dcprint.cpp +++ b/src/osx/carbon/dcprint.cpp @@ -105,6 +105,10 @@ wxMacCarbonPrinterDC::wxMacCarbonPrinterDC( wxPrintData* data ) { #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 } } @@ -168,7 +172,10 @@ bool wxMacCarbonPrinterDC::StartDoc( wxPrinterDC* dc , const wxString& message #endif { #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 - m_err = PMPrinterGetPrinterResolution(printer, kPMCurrentValue, &res); + if ( PMPrinterGetPrinterResolution(printer, kPMCurrentValue, &res) != noErr ) + { + res.hRes = res.vRes = 300; + } #endif } } -- 2.50.0