adding correct assignement and copy constructors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -19,6 +19,7 @@ public:
|
||||
|
||||
wxDataFormat();
|
||||
wxDataFormat(wxDataFormatId vType);
|
||||
wxDataFormat(const wxDataFormat& rFormat);
|
||||
wxDataFormat(const wxString& rId);
|
||||
wxDataFormat(const wxChar* pId);
|
||||
wxDataFormat(NativeFormat vFormat);
|
||||
@@ -36,6 +37,8 @@ public:
|
||||
bool operator!=(wxDataFormatId format) const
|
||||
{ return m_type != (wxDataFormatId)format; }
|
||||
|
||||
wxDataFormat& operator=(const wxDataFormat& format);
|
||||
|
||||
// explicit and implicit conversions to NativeFormat which is one of
|
||||
// standard data types (implicit conversion is useful for preserving the
|
||||
// compatibility with old code)
|
||||
|
@@ -67,6 +67,16 @@ wxDataFormat::wxDataFormat( const wxString& rId )
|
||||
SetId( rId );
|
||||
}
|
||||
|
||||
wxDataFormat::wxDataFormat(const wxDataFormat& rFormat)
|
||||
{
|
||||
if ( rFormat.m_format )
|
||||
m_format = (NativeFormat) CFStringCreateCopy(NULL, (CFStringRef)rFormat.m_format);
|
||||
else
|
||||
m_format = 0;
|
||||
m_type = rFormat.m_type;
|
||||
m_id = rFormat.m_id;
|
||||
}
|
||||
|
||||
wxDataFormat::wxDataFormat( NativeFormat vFormat )
|
||||
{
|
||||
m_format = 0;
|
||||
@@ -87,6 +97,20 @@ wxDataFormat::~wxDataFormat()
|
||||
// http://developer.apple.com/qa/qa2005/qa1406.html
|
||||
// TODO : Use UTCoreTypes.h constants once we support 10.4+ only
|
||||
|
||||
wxDataFormat& wxDataFormat::operator=(const wxDataFormat& rFormat)
|
||||
{
|
||||
if ( m_format != 0 )
|
||||
{
|
||||
CFRelease( (CFStringRef) m_format );
|
||||
m_format = 0;
|
||||
}
|
||||
if ( rFormat.m_format )
|
||||
m_format = (NativeFormat) CFStringCreateCopy(NULL, (CFStringRef)rFormat.m_format);
|
||||
m_type = rFormat.m_type;
|
||||
m_id = rFormat.m_id;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxDataFormat::SetType( wxDataFormatId dataType )
|
||||
{
|
||||
m_type = dataType;
|
||||
|
Reference in New Issue
Block a user