Adapted SetData function to common API (taking a reference
instead of a pointer) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9845 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -78,7 +78,7 @@ public:
|
|||||||
virtual bool IsSupported( wxDataFormat format );
|
virtual bool IsSupported( wxDataFormat format );
|
||||||
|
|
||||||
// fill data with data on the clipboard (if available)
|
// fill data with data on the clipboard (if available)
|
||||||
virtual bool GetData( wxDataObject *data );
|
virtual bool GetData( wxDataObject& data );
|
||||||
|
|
||||||
// clears wxTheClipboard and the system's clipboard if possible
|
// clears wxTheClipboard and the system's clipboard if possible
|
||||||
virtual void Clear();
|
virtual void Clear();
|
||||||
|
@@ -533,12 +533,12 @@ bool wxClipboard::IsSupported( wxDataFormat format )
|
|||||||
return wxIsClipboardFormatAvailable(format);
|
return wxIsClipboardFormatAvailable(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxClipboard::GetData( wxDataObject *data )
|
bool wxClipboard::GetData( wxDataObject& data )
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
|
wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") );
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
// wxDataFormat format = data->GetFormat();
|
// wxDataFormat format = data.GetFormat();
|
||||||
// TODO:
|
// TODO:
|
||||||
/*
|
/*
|
||||||
switch ( format )
|
switch ( format )
|
||||||
@@ -546,11 +546,11 @@ bool wxClipboard::GetData( wxDataObject *data )
|
|||||||
case wxDF_TEXT:
|
case wxDF_TEXT:
|
||||||
case wxDF_OEMTEXT:
|
case wxDF_OEMTEXT:
|
||||||
{
|
{
|
||||||
wxTextDataObject* textDataObject = (wxTextDataObject*) data;
|
wxTextDataObject& textDataObject = (wxTextDataObject&) data;
|
||||||
char* s = (char*) wxGetClipboardData(format);
|
char* s = (char*) wxGetClipboardData(format);
|
||||||
if ( s )
|
if ( s )
|
||||||
{
|
{
|
||||||
textDataObject->SetText(s);
|
textDataObject.SetText(s);
|
||||||
delete[] s;
|
delete[] s;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -561,11 +561,11 @@ bool wxClipboard::GetData( wxDataObject *data )
|
|||||||
case wxDF_BITMAP:
|
case wxDF_BITMAP:
|
||||||
case wxDF_DIB:
|
case wxDF_DIB:
|
||||||
{
|
{
|
||||||
wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject *)data;
|
wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data;
|
||||||
wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetFormat());
|
wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data->GetFormat());
|
||||||
if (bitmap)
|
if (bitmap)
|
||||||
{
|
{
|
||||||
bitmapDataObject->SetBitmap(* bitmap);
|
bitmapDataObject.SetBitmap(* bitmap);
|
||||||
delete bitmap;
|
delete bitmap;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -575,11 +575,11 @@ bool wxClipboard::GetData( wxDataObject *data )
|
|||||||
#if wxUSE_METAFILE
|
#if wxUSE_METAFILE
|
||||||
case wxDF_METAFILE:
|
case wxDF_METAFILE:
|
||||||
{
|
{
|
||||||
wxMetafileDataObject* metaFileDataObject = (wxMetafileDataObject *)data;
|
wxMetafileDataObject& metaFileDataObject = (wxMetafileDataObject &)data;
|
||||||
wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE);
|
wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE);
|
||||||
if (metaFile)
|
if (metaFile)
|
||||||
{
|
{
|
||||||
metaFileDataObject->SetMetafile(*metaFile);
|
metaFileDataObject.SetMetafile(*metaFile);
|
||||||
delete metaFile;
|
delete metaFile;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -594,7 +594,7 @@ bool wxClipboard::GetData( wxDataObject *data )
|
|||||||
if ( buf )
|
if ( buf )
|
||||||
{
|
{
|
||||||
// FIXME this is for testing only!!
|
// FIXME this is for testing only!!
|
||||||
((wxPrivateDataObject *)data)->SetData(buf, len);
|
((wxPrivateDataObject &)data).SetData(buf, len);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user