From: Julian Smart Date: Thu, 28 Feb 2008 18:44:43 +0000 (+0000) Subject: Open and Close clipboard properly X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3214ac5ad1d515d917b8273c2d2af4c4287b7a8b?hp=6d1f75adcefcdab581b549dd0cbeea6eff21a4a4 Open and Close clipboard properly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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; } }