X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/292e5e1f17af67a5885f1fdaa8c45a8a5a2a3ca5..e3e061ee13588c0aa29640436e1b895b929c1c04:/src/osx/carbon/graphics.cpp?ds=sidebyside diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 8003ae76a1..cef1c5d805 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1941,8 +1941,7 @@ void wxMacCoreGraphicsContext::PopState() void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y ) { - if ( m_font.IsNull() ) - return; + wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") ); EnsureIsValid(); #if wxOSX_USE_CORE_TEXT @@ -1998,8 +1997,7 @@ void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDoub void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle ) { - if ( m_font.IsNull() ) - return; + wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") ); EnsureIsValid(); #if wxOSX_USE_CORE_TEXT @@ -2103,7 +2101,7 @@ void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDoub void wxMacCoreGraphicsContext::GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height, wxDouble *descent, wxDouble *externalLeading ) const { - wxCHECK_RET( !m_font.IsNull(), wxT("wxDC(cg)::DoGetTextExtent - no valid font set") ); + wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::GetTextExtent - no valid font set") ); if ( width ) *width = 0; @@ -2207,6 +2205,8 @@ void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArr widths.Empty(); widths.Add(0, text.length()); + wxCHECK_RET( !m_font.IsNull(), wxT("wxMacCoreGraphicsContext::DrawText - no valid font set") ); + if (text.empty()) return; @@ -2356,7 +2356,9 @@ public : virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc); virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc); +#if wxUSE_PRINTING_ARCHITECTURE virtual wxGraphicsContext * CreateContext( const wxPrinterDC& dc); +#endif virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ); @@ -2453,9 +2455,9 @@ wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxMemoryDC& return NULL; } +#if wxUSE_PRINTING_ARCHITECTURE wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxPrinterDC& dc ) { -#if wxUSE_PRINTING_ARCHITECTURE #ifdef __WXMAC__ const wxDCImpl* impl = dc.GetImpl(); wxPrinterDCImpl *print_impl = wxDynamicCast( impl, wxPrinterDCImpl ); @@ -2466,10 +2468,10 @@ wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxPrinterDC& return new wxMacCoreGraphicsContext( this, (CGContextRef)(print_impl->GetGraphicsContext()->GetNativeContext()), (wxDouble) w, (wxDouble) h ); } -#endif #endif return NULL; } +#endif wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeContext( void * context ) {