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;
wxString(text, maxTextLength).c_str(),
(text.length() > maxTextLength) ? _T("...")
: _T("")));
+ wxTheClipboard->Close();
+
return;
}
}