]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/html/test/test.cpp
reset deferred position/size if the window was moved immediately (#10073)
[wxWidgets.git] / samples / html / test / test.cpp
index ae1dee0c81998178e3c304f099945b5bb65b3049..176bc81b428f4c33e15e96df15cbf22cd4688565 100644 (file)
@@ -154,6 +154,9 @@ IMPLEMENT_APP(MyApp)
 // `Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
 #if wxUSE_SYSTEM_OPTIONS
     wxSystemOptions::SetOption(wxT("no-maskblt"), 1);
 #endif
@@ -355,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;
@@ -364,6 +367,8 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event))
                         wxString(text, maxTextLength).c_str(),
                         (text.length() > maxTextLength) ? _T("...")
                                                         : _T("")));
+            wxTheClipboard->Close();
+
             return;
         }
     }