From e26c0634d0040057f09d902842c2b77aa9f0cbfc Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 24 Oct 2001 17:46:31 +0000 Subject: [PATCH] Changed CanPaste to just check IsSupported. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 9 ++++----- src/stc/ScintillaWX.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 023a0f92d0..1dfc0184a7 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -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; diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 023a0f92d0..1dfc0184a7 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -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; -- 2.45.2