Open and Close clipboard properly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -358,7 +358,7 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event))
|
|||||||
if ( CopySelection() )
|
if ( CopySelection() )
|
||||||
{
|
{
|
||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
if ( wxTheClipboard && wxTheClipboard->GetData(data) )
|
if ( wxTheClipboard && wxTheClipboard->Open() && wxTheClipboard->GetData(data) )
|
||||||
{
|
{
|
||||||
const wxString text = data.GetText();
|
const wxString text = data.GetText();
|
||||||
const size_t maxTextLength = 100;
|
const size_t maxTextLength = 100;
|
||||||
@@ -367,6 +367,8 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event))
|
|||||||
wxString(text, maxTextLength).c_str(),
|
wxString(text, maxTextLength).c_str(),
|
||||||
(text.length() > maxTextLength) ? _T("...")
|
(text.length() > maxTextLength) ? _T("...")
|
||||||
: _T("")));
|
: _T("")));
|
||||||
|
wxTheClipboard->Close();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user