From 511383f91b1443d576276c826fdfd5286f9dbbdb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 15 Aug 2007 11:52:13 +0000 Subject: [PATCH] fix wrong clear selection (modified patch 1763916) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/clipbrd.h | 9 ++++++++- src/gtk/clipbrd.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/wx/gtk/clipbrd.h b/include/wx/gtk/clipbrd.h index df95600542..04f26042eb 100644 --- a/include/wx/gtk/clipbrd.h +++ b/include/wx/gtk/clipbrd.h @@ -73,12 +73,19 @@ public: bool GTKOnTargetReceived(const wxDataFormat& format); private: + // the data object for the specific selection + wxDataObject *& Data(Kind kind) + { + return kind == Primary ? m_dataPrimary : m_dataClipboard; + } + // the data object we're currently using wxDataObject *& Data() { - return m_usePrimary ? m_dataPrimary : m_dataClipboard; + return Data(m_usePrimary ? Primary : Clipboard); } + // set or unset selection ownership bool SetSelectionOwner(bool set = true); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 483b6beca4..649b4424d8 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -409,7 +409,7 @@ GdkAtom wxClipboard::GTKGetClipboardAtom() const void wxClipboard::GTKClearData(Kind kind) { - wxDataObject *&data = Data(); + wxDataObject *&data = Data(kind); if ( data ) { delete data; -- 2.45.2