X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45e6e6f8ab806b337dffeb3b52fec7eba3c845ef..6a7e5ea2f5c412f92316c260b8531cff6d5cb231:/samples/html/test/test.cpp 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; } }