]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/metafile.cpp
fixes #13557
[wxWidgets.git] / src / osx / carbon / metafile.cpp
index 13d0ef77076a76b04364cbe839d59217a99da942..0d7607c6f7f8f86188f15940762f2d3de9193bf9 100644 (file)
@@ -76,6 +76,11 @@ private:
 
     int m_width ;
     int m_height ;
+
+
+    // Our m_pdfDoc field can't be easily (deep) copied and so we don't define a
+    // copy ctor.
+    wxDECLARE_NO_COPY_CLASS(wxMetafileRefData);
 };
 
 wxMetafileRefData::wxMetafileRefData(CFDataRef data) :
@@ -175,9 +180,12 @@ wxGDIRefData *wxMetaFile::CreateGDIRefData() const
     return new wxMetafileRefData;
 }
 
-wxGDIRefData *wxMetaFile::CloneGDIRefData(const wxGDIRefData *data) const
+wxGDIRefData *
+wxMetaFile::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const
 {
-    return new wxMetafileRefData(*static_cast<const wxMetafileRefData *>(data));
+    wxFAIL_MSG( wxS("Cloning metafiles is not implemented in wxCarbon.") );
+
+    return new wxMetafileRefData;
 }
 
 WXHMETAFILE wxMetaFile::GetHMETAFILE() const
@@ -216,26 +224,6 @@ void wxMetafile::SetHMETAFILE(WXHMETAFILE mf)
     m_refData = new wxMetafileRefData((CFDataRef)mf);
 }
 
-#if wxOSX_USE_COCOA_OR_CARBON && !defined( __LP64__ )
-void wxMetafile::SetPICT(void* pictHandle)
-{
-    UnRef();
-
-    Handle picHandle = (Handle) pictHandle;
-    HLock(picHandle);
-    CFDataRef data = CFDataCreateWithBytesNoCopy( kCFAllocatorDefault, (const UInt8*) *picHandle, GetHandleSize(picHandle), kCFAllocatorNull);
-    wxCFRef<CGDataProviderRef> provider(wxMacCGDataProviderCreateWithCFData(data));
-    QDPictRef pictRef = QDPictCreateWithProvider(provider);
-    CGRect rect = QDPictGetBounds(pictRef);
-    m_refData = new wxMetafileRefData(static_cast<int>(rect.size.width),
-                                      static_cast<int>(rect.size.height));
-    QDPictDrawToCGContext( ((wxMetafileRefData*) m_refData)->GetContext(), rect, pictRef );
-    CFRelease( data );
-    QDPictRelease( pictRef );
-    ((wxMetafileRefData*) m_refData)->Close();
-}
-#endif
-
 bool wxMetaFile::Play(wxDC *dc)
 {
     if (!m_refData)
@@ -266,7 +254,7 @@ wxSize wxMetaFile::GetSize() const
 {
     wxSize dataSize = wxDefaultSize;
 
-    if (Ok())
+    if (IsOk())
     {
         dataSize.x = M_METAFILEDATA->GetWidth();
         dataSize.y = M_METAFILEDATA->GetHeight();