]> git.saurik.com Git - wxWidgets.git/commitdiff
You can't paste if someone else already has the clipboard open...
authorRobin Dunn <robin@alldunn.com>
Sun, 25 Aug 2002 04:20:18 +0000 (04:20 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 25 Aug 2002 04:20:18 +0000 (04:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/stc/ScintillaWX.cpp
src/stc/ScintillaWX.cpp

index 1bf2c8800a92d0346e31d446c55a1be510d5a0ad..200a36cbf0f2d6a706468549a6d3deabdbc590b1 100644 (file)
@@ -355,13 +355,14 @@ void ScintillaWX::Paste() {
 
 
 bool ScintillaWX::CanPaste() {
-    bool canPaste;
-
-    wxTheClipboard->Open();
-    wxTheClipboard->UsePrimarySelection();
-    canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
-    wxTheClipboard->Close();
+    bool canPaste = FALSE;
 
+    if (! wxTheClipboard->IsOpened()) {
+        wxTheClipboard->Open();
+        wxTheClipboard->UsePrimarySelection();
+        canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
+        wxTheClipboard->Close();
+    }
     return canPaste;
 }
 
index 1bf2c8800a92d0346e31d446c55a1be510d5a0ad..200a36cbf0f2d6a706468549a6d3deabdbc590b1 100644 (file)
@@ -355,13 +355,14 @@ void ScintillaWX::Paste() {
 
 
 bool ScintillaWX::CanPaste() {
-    bool canPaste;
-
-    wxTheClipboard->Open();
-    wxTheClipboard->UsePrimarySelection();
-    canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
-    wxTheClipboard->Close();
+    bool canPaste = FALSE;
 
+    if (! wxTheClipboard->IsOpened()) {
+        wxTheClipboard->Open();
+        wxTheClipboard->UsePrimarySelection();
+        canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
+        wxTheClipboard->Close();
+    }
     return canPaste;
 }