X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/96dabe431382e288fc1ccc561f62c400895ac0fa..3678169caab0f713415414dce013a638305f3cce:/src/osx/core/dcmemory.cpp diff --git a/src/osx/core/dcmemory.cpp b/src/osx/core/dcmemory.cpp index a21782eaae..eabdc34f98 100644 --- a/src/osx/core/dcmemory.cpp +++ b/src/osx/core/dcmemory.cpp @@ -55,31 +55,29 @@ void wxMemoryDCImpl::Init() wxMemoryDCImpl::~wxMemoryDCImpl() { - if ( m_selected.Ok() ) + if ( m_selected.IsOk() ) { m_selected.EndRawAccess() ; - delete m_graphicContext ; - m_graphicContext = NULL ; + wxDELETE(m_graphicContext); } } void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) { - if ( m_selected.Ok() ) + if ( m_selected.IsOk() ) { m_selected.EndRawAccess() ; - delete m_graphicContext ; - m_graphicContext = NULL ; + wxDELETE(m_graphicContext); } m_selected = bitmap; - if (m_selected.Ok()) + if (m_selected.IsOk()) { if ( m_selected.GetDepth() != 1 ) m_selected.UseAlpha() ; m_selected.BeginRawAccess() ; - m_width = bitmap.GetWidth(); - m_height = bitmap.GetHeight(); + m_width = bitmap.GetWidth(); + m_height = bitmap.GetHeight(); CGColorSpaceRef genericColorSpace = wxMacGetGenericRGBColorSpace(); CGContextRef bmCtx = (CGContextRef) m_selected.GetHBITMAP(); @@ -87,7 +85,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) { CGContextSetFillColorSpace( bmCtx, genericColorSpace ); CGContextSetStrokeColorSpace( bmCtx, genericColorSpace ); - SetGraphicsContext( wxGraphicsContext::CreateFromNative( bmCtx ) ); + SetGraphicsContext( wxGraphicsContext::CreateFromNative( bmCtx ) ); } m_ok = (m_graphicContext != NULL) ; } @@ -99,7 +97,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (width) (*width) = m_selected.GetWidth();