#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/log.h"
+ #include "wx/dataobj.h"
#endif
#if wxUSE_METAFILE
// the functions using wxDataObject in wxClipboard
//#define wxUSE_DATAOBJ wxUSE_DRAG_AND_DROP
-#if wxUSE_DATAOBJ
- #include "wx/dataobj.h"
-#endif
-
#if wxUSE_OLE && !defined(__WXWINCE__)
// use OLE clipboard
#define wxUSE_OLE_CLIPBOARD 1
void wxClipboard::Clear()
{
+ if ( IsUsingPrimarySelection() )
+ return;
+
#if wxUSE_OLE_CLIPBOARD
if (m_lastDataObject)
{
if (S_OK == hr)
{
hr = OleSetClipboard(NULL);
- if ( FAILED(hr) )
- {
- wxLogApiError(wxT("OleSetClipboard(NULL)"), hr);
- }
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxT("OleSetClipboard(NULL)"), hr);
+ }
}
m_lastDataObject = NULL;
}
if (S_OK == hr)
{
hr = OleFlushClipboard();
- if ( FAILED(hr) )
- {
- wxLogApiError(wxT("OleFlushClipboard"), hr);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxT("OleFlushClipboard"), hr);
- return false;
- }
- return true;
- }
+ return false;
+ }
+ return true;
+ }
}
return false;
#else // !wxUSE_OLE_CLIPBOARD
bool wxClipboard::SetData( wxDataObject *data )
{
+ if ( IsUsingPrimarySelection() )
+ return false;
+
#if !wxUSE_OLE_CLIPBOARD
(void)wxEmptyClipboard();
#endif // wxUSE_OLE_CLIPBOARD
bool wxClipboard::AddData( wxDataObject *data )
{
+ if ( IsUsingPrimarySelection() )
+ return false;
+
wxCHECK_MSG( data, false, wxT("data is invalid") );
#if wxUSE_OLE_CLIPBOARD
bool wxClipboard::IsSupported( const wxDataFormat& format )
{
- return wxIsClipboardFormatAvailable(format);
+ return !IsUsingPrimarySelection() && wxIsClipboardFormatAvailable(format);
}
bool wxClipboard::GetData( wxDataObject& data )
{
+ if ( IsUsingPrimarySelection() )
+ return false;
+
#if wxUSE_OLE_CLIPBOARD
IDataObject *pDataObject = NULL;
HRESULT hr = OleGetClipboard(&pDataObject);