X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f0c8f31f407ecfce909060464c0ea655221cdab..6178debcd342963974dbdce6ac2ddb2fbe89e42a:/src/osx/carbon/metafile.cpp diff --git a/src/osx/carbon/metafile.cpp b/src/osx/carbon/metafile.cpp index 464cd9ae63..13d0ef7707 100644 --- a/src/osx/carbon/metafile.cpp +++ b/src/osx/carbon/metafile.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/metafile.cpp +// Name: src/osx/carbon/metafile.cpp // Purpose: wxMetaFile, wxMetaFileDC etc. These classes are optional. // Author: Stefan Csomor // Modified by: @@ -24,9 +24,9 @@ #include "wx/metafile.h" #include "wx/clipbrd.h" -#include "wx/osx/uma.h" +#include "wx/osx/private.h" #include "wx/graphics.h" -#include "wx/osx/carbon/metafile.h" +#include "wx/osx/metafile.h" #include #include @@ -156,8 +156,8 @@ void wxMetafileRefData::UpdateDocumentFromData() { CGPDFPageRef page = CGPDFDocumentGetPage( m_pdfDoc, 1 ); CGRect rect = CGPDFPageGetBoxRect ( page, kCGPDFMediaBox); - m_width = wx_static_cast(int, rect.size.width); - m_height = wx_static_cast(int, rect.size.height); + m_width = static_cast(rect.size.width); + m_height = static_cast(rect.size.height); } } @@ -177,7 +177,7 @@ wxGDIRefData *wxMetaFile::CreateGDIRefData() const wxGDIRefData *wxMetaFile::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data)); + return new wxMetafileRefData(*static_cast(data)); } WXHMETAFILE wxMetaFile::GetHMETAFILE() const @@ -216,7 +216,7 @@ void wxMetafile::SetHMETAFILE(WXHMETAFILE mf) m_refData = new wxMetafileRefData((CFDataRef)mf); } -#ifndef __LP64__ +#if wxOSX_USE_COCOA_OR_CARBON && !defined( __LP64__ ) void wxMetafile::SetPICT(void* pictHandle) { UnRef(); @@ -227,8 +227,8 @@ void wxMetafile::SetPICT(void* pictHandle) wxCFRef provider(wxMacCGDataProviderCreateWithCFData(data)); QDPictRef pictRef = QDPictCreateWithProvider(provider); CGRect rect = QDPictGetBounds(pictRef); - m_refData = new wxMetafileRefData(wx_static_cast(int, rect.size.width), - wx_static_cast(int, rect.size.height)); + m_refData = new wxMetafileRefData(static_cast(rect.size.width), + static_cast(rect.size.height)); QDPictDrawToCGContext( ((wxMetafileRefData*) m_refData)->GetContext(), rect, pictRef ); CFRelease( data ); QDPictRelease( pictRef ); @@ -318,8 +318,7 @@ void wxMetafileDCImpl::DoGetSize(int *width, int *height) const wxMetaFile *wxMetafileDCImpl::Close() { - delete m_graphicContext; - m_graphicContext = NULL; + wxDELETE(m_graphicContext); m_ok = false; M_METAFILEREFDATA(*m_metaFile)->Close();