patch 1352744

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2005-11-19 13:05:14 +00:00
parent 90e572f1e5
commit 21ec3bf99c

View File

@@ -60,10 +60,8 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
case wxDF_METAFILE : case wxDF_METAFILE :
break ; break ;
default: default:
{ // custom datatype
wxLogError(_("Unsupported clipboard format.")); break ;
return NULL;
}
} }
#if TARGET_CARBON #if TARGET_CARBON
@@ -226,12 +224,12 @@ bool wxClipboard::AddData( wxDataObject *data )
wxCHECK_MSG( data, false, wxT("data is invalid") ); wxCHECK_MSG( data, false, wxT("data is invalid") );
/* we can only store one wxDataObject */ // we can only store one wxDataObject
Clear(); Clear();
m_data = data; m_data = data;
/* get formats from wxDataObjects */ // get formats from wxDataObjects
wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ]; wxDataFormat *array = new wxDataFormat[ m_data->GetFormatCount() ];
m_data->GetAllFormats( array ); m_data->GetAllFormats( array );
@@ -272,6 +270,7 @@ bool wxClipboard::AddData( wxDataObject *data )
mactype = kScrapFlavorTypePicture ; mactype = kScrapFlavorTypePicture ;
break ; break ;
default: default:
mactype = (OSType)(array[i].GetFormatId());
break ; break ;
} }
UMAPutScrap( sz , mactype , buf ) ; UMAPutScrap( sz , mactype , buf ) ;
@@ -297,7 +296,6 @@ void wxClipboard::Close()
delete m_data; delete m_data;
m_data = (wxDataObject*) NULL; m_data = (wxDataObject*) NULL;
} }
} }
bool wxClipboard::IsSupported( const wxDataFormat &dataFormat ) bool wxClipboard::IsSupported( const wxDataFormat &dataFormat )
@@ -373,7 +371,8 @@ bool wxClipboard::GetData( wxDataObject& data )
} }
} }
} }
/* get formats from wxDataObjects */
// get formats from wxDataObjects
if ( !transferred ) if ( !transferred )
{ {
for (size_t i = 0; !transferred && i < formatcount ; i++) for (size_t i = 0; !transferred && i < formatcount ; i++)
@@ -382,11 +381,13 @@ bool wxClipboard::GetData( wxDataObject& data )
switch ( format.GetType() ) switch ( format.GetType() )
{ {
// NOTE: this is usable for all data types
case wxDF_TEXT : case wxDF_TEXT :
case wxDF_UNICODETEXT: case wxDF_UNICODETEXT:
case wxDF_OEMTEXT : case wxDF_OEMTEXT :
case wxDF_BITMAP : case wxDF_BITMAP :
case wxDF_METAFILE : case wxDF_METAFILE :
default :
{ {
long len ; long len ;
char* s = (char*)wxGetClipboardData(format, &len ); char* s = (char*)wxGetClipboardData(format, &len );
@@ -399,9 +400,6 @@ bool wxClipboard::GetData( wxDataObject& data )
} }
} }
break ; break ;
default :
break ;
} }
} }
} }