]> git.saurik.com Git - wxWidgets.git/commitdiff
Open and Close clipboard properly
authorJulian Smart <julian@anthemion.co.uk>
Thu, 28 Feb 2008 18:44:43 +0000 (18:44 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 28 Feb 2008 18:44:43 +0000 (18:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/html/test/test.cpp

index 59b006e2bbb17eaf768f9549b1de7274ef4c7848..176bc81b428f4c33e15e96df15cbf22cd4688565 100644 (file)
@@ -358,7 +358,7 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event))
     if ( CopySelection() )
     {
         wxTextDataObject data;
     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;
         {
             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("")));
                         wxString(text, maxTextLength).c_str(),
                         (text.length() > maxTextLength) ? _T("...")
                                                         : _T("")));
+            wxTheClipboard->Close();
+
             return;
         }
     }
             return;
         }
     }