From 2c3cfbb21cd4f236d826edbcd14bcf03af6d621e Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 28 Feb 2008 18:44:24 +0000 Subject: [PATCH] Open and Close clipboard properly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/html/test/test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/html/test/test.cpp b/samples/html/test/test.cpp index ae1dee0c81..069bd252df 100644 --- a/samples/html/test/test.cpp +++ b/samples/html/test/test.cpp @@ -355,7 +355,7 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event)) if ( CopySelection() ) { wxTextDataObject data; - if ( wxTheClipboard && wxTheClipboard->GetData(data) ) + if ( wxTheClipboard && wxTheClipboard->Open() && wxTheClipboard->GetData(data) ) { const wxString text = data.GetText(); const size_t maxTextLength = 100; @@ -364,6 +364,9 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event)) wxString(text, maxTextLength).c_str(), (text.length() > maxTextLength) ? _T("...") : _T(""))); + + wxTheClipboard->Close(); + return; } }