From 3214ac5ad1d515d917b8273c2d2af4c4287b7a8b Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 28 Feb 2008 18:44:43 +0000 Subject: [PATCH] Open and Close clipboard properly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/html/test/test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/html/test/test.cpp b/samples/html/test/test.cpp index 59b006e2bb..176bc81b42 100644 --- a/samples/html/test/test.cpp +++ b/samples/html/test/test.cpp @@ -358,7 +358,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; @@ -367,6 +367,8 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event)) wxString(text, maxTextLength).c_str(), (text.length() > maxTextLength) ? _T("...") : _T(""))); + wxTheClipboard->Close(); + return; } } -- 2.45.2