wxIcon and wxMetaFile implemented CloneGDIRefData() using copy ctors of the
corresponding ref data classes but the copy ctors were either wrong (for
wxIconRefData as using it would result in messing up IconRef reference count)
or had wrong semantics (wxMetafileRefData copy ctor performed shallow copy
only while CloneGDIRefData() supposes a deep copy is done).
Replace the wrong implementations of these functions with assert that will be
triggered if they are ever used (which doesn't seem to be the case so far).
See #12768.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66373
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
IconRef m_iconRef;
int m_width;
int m_height;
+
+ // We can (easily) copy m_iconRef so we don't implement the copy ctor.
+ wxDECLARE_NO_COPY_CLASS(wxIconRefData);
};
return new wxIconRefData;
}
-wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const
+wxGDIRefData *
+wxIcon::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const
{
- return new wxIconRefData(*static_cast<const wxIconRefData *>(data));
+ wxFAIL_MSG( wxS("Cloning icons is not implemented in wxCarbon.") );
+
+ return new wxIconRefData;
}
WXHICON wxIcon::GetHICON() const
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) :
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