/////////////////////////////////////////////////////////////////////////////
-// Name: clipbrd.cpp
+// Name: src/msw/clipbrd.cpp
// Purpose: Clipboard functionality
// Author: Julian Smart
// Modified by:
#if wxUSE_CLIPBOARD
+#include "wx/clipbrd.h"
+
#ifndef WX_PRECOMP
#include "wx/object.h"
#include "wx/event.h"
#include "wx/bitmap.h"
#include "wx/utils.h"
#include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/dataobj.h"
#endif
#if wxUSE_METAFILE
#include "wx/metafile.h"
#endif
-#include "wx/log.h"
-#include "wx/clipbrd.h"
#include <string.h>
// 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);
}
#endif // wxUSE_CLIPBOARD
-