]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/clipbrd.cpp
fixed LastRead() after Read(wxOutputStream&) (patch 1658301)
[wxWidgets.git] / src / msw / clipbrd.cpp
index 3c233998730f770128c80ca64fb5e12010627b51..4a1518b0ff247fe687f53a67f20627cde559030b 100644 (file)
@@ -537,9 +537,7 @@ wxClipboard::~wxClipboard()
 {
     if ( m_lastDataObject )
     {
-        // Retain any remaining clipboard data
-        // after application exits.
-        Flush();
+        Clear();
     }
 
 #if wxUSE_OLE_CLIPBOARD
@@ -557,10 +555,10 @@ void wxClipboard::Clear()
         if (S_OK == hr)
         {
             hr = OleSetClipboard(NULL);
-    if ( FAILED(hr) )
-    {
-        wxLogApiError(wxT("OleSetClipboard(NULL)"), hr);
-    }
+            if ( FAILED(hr) )
+            {
+                wxLogApiError(wxT("OleSetClipboard(NULL)"), hr);
+            }
         }
         m_lastDataObject = NULL;
     }
@@ -578,14 +576,14 @@ bool wxClipboard::Flush()
         if (S_OK == hr)
         {
             hr = OleFlushClipboard();
-    if ( FAILED(hr) )
-    {
-        wxLogApiError(wxT("OleFlushClipboard"), hr);
+            if ( FAILED(hr) )
+            {
+                wxLogApiError(wxT("OleFlushClipboard"), hr);
 
-        return false;
-    }
-        return true;
-    }
+                return false;
+            }
+            return true;
+        }
     }
     return false;
 #else // !wxUSE_OLE_CLIPBOARD