]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed CanPaste to just check IsSupported.
authorRobin Dunn <robin@alldunn.com>
Wed, 24 Oct 2001 17:46:31 +0000 (17:46 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 24 Oct 2001 17:46:31 +0000 (17:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 023a0f92d0eec53f0d17e22a293374487beef59e..1dfc0184a7cbb90f46a9d8d8f4f8c8042e156a56 100644 (file)
@@ -246,12 +246,12 @@ void ScintillaWX::Paste() {
     ClearSelection();
 
     wxTextDataObject data;
-    bool canPaste;
+    bool gotData;
 
     wxTheClipboard->Open();
-    canPaste = wxTheClipboard->GetData(data);
+    gotData = wxTheClipboard->GetData(data);
     wxTheClipboard->Close();
-    if (canPaste) {
+    if (gotData) {
         wxString str = data.GetText();
         int      len = str.Length();
         pdoc->InsertString(currentPos, str.c_str(), len);
@@ -265,11 +265,10 @@ void ScintillaWX::Paste() {
 
 
 bool ScintillaWX::CanPaste() {
-    wxTextDataObject data;
     bool canPaste;
 
     wxTheClipboard->Open();
-    canPaste = wxTheClipboard->GetData(data);
+    canPaste = wxTheClipboard->IsSupported( wxDF_TEXT );
     wxTheClipboard->Close();
 
     return canPaste;
index 023a0f92d0eec53f0d17e22a293374487beef59e..1dfc0184a7cbb90f46a9d8d8f4f8c8042e156a56 100644 (file)
@@ -246,12 +246,12 @@ void ScintillaWX::Paste() {
     ClearSelection();
 
     wxTextDataObject data;
-    bool canPaste;
+    bool gotData;
 
     wxTheClipboard->Open();
-    canPaste = wxTheClipboard->GetData(data);
+    gotData = wxTheClipboard->GetData(data);
     wxTheClipboard->Close();
-    if (canPaste) {
+    if (gotData) {
         wxString str = data.GetText();
         int      len = str.Length();
         pdoc->InsertString(currentPos, str.c_str(), len);
@@ -265,11 +265,10 @@ void ScintillaWX::Paste() {
 
 
 bool ScintillaWX::CanPaste() {
-    wxTextDataObject data;
     bool canPaste;
 
     wxTheClipboard->Open();
-    canPaste = wxTheClipboard->GetData(data);
+    canPaste = wxTheClipboard->IsSupported( wxDF_TEXT );
     wxTheClipboard->Close();
 
     return canPaste;